-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
27 lines (25 loc) · 687 Bytes
/
main.cpp
File metadata and controls
27 lines (25 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
// main.cpp
// go-socket-client
//
// Copyright © 2023 Yan. All rights reserved.
//
#include <iostream>
#include "net_core.hpp"
#include "packet/tcp_error.hpp"
#include "log/zlogger.hpp"
#include <stdlib.h>
#include <vector>
#include "unit_test.hpp"
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
NetCore::InitHostAndPort("127.0.0.1", "127.0.0.1", 8080, false, []()->std::string{
return "{\"username\":\"haha\", \"password\":\"xxxxx\"}";
});
NetCore::SetOnConnStatusChange([](ConnectStatus status){
printf("status to: %d\n", status);
});
NetCore::MakeSureConnected();
return 0;
}