[DEV] some update
This commit is contained in:
@@ -30,7 +30,7 @@ int main(int _argc, const char *_argv[]) {
|
||||
// client mode ...
|
||||
enet::Tcp connection;
|
||||
connection.setHostNane("127.0.0.1");
|
||||
connection.setPort(31234);
|
||||
connection.setPort(31235);
|
||||
connection.setServer(false);
|
||||
TEST_INFO("CLIENT connect ...");
|
||||
if (connection.link() == false) {
|
||||
@@ -43,6 +43,10 @@ int main(int _argc, const char *_argv[]) {
|
||||
char data[1024];
|
||||
int32_t len = connection.read(data, 1024);
|
||||
TEST_INFO("read len=" << len << " data='" << data << "'");
|
||||
//if (data[len-1] == '2') {
|
||||
int32_t lenWrite = connection.write("get pair value");
|
||||
TEST_INFO("write len=" << lenWrite);
|
||||
//}
|
||||
iii++;
|
||||
}
|
||||
if (iii>=10000) {
|
||||
|
@@ -30,7 +30,7 @@ int main(int _argc, const char *_argv[]) {
|
||||
// server mode ...
|
||||
enet::Tcp connection;
|
||||
connection.setHostNane("127.0.0.1");
|
||||
connection.setPort(31234);
|
||||
connection.setPort(31235);
|
||||
connection.setServer(true);
|
||||
TEST_INFO("SERVER connect ...");
|
||||
if (connection.link() == false) {
|
||||
@@ -41,6 +41,11 @@ int main(int _argc, const char *_argv[]) {
|
||||
while (connection.getConnectionStatus() == enet::Tcp::statusLink) {
|
||||
int32_t len = connection.write("plop" + etk::to_string(iii));
|
||||
TEST_INFO("write len=" << len);
|
||||
char data[1024];
|
||||
len = connection.read(data, 1024);
|
||||
if (len > 0) {
|
||||
TEST_INFO("read len=" << len << " data='" << data << "'");
|
||||
}
|
||||
iii++;
|
||||
}
|
||||
if (iii>=1000000) {
|
||||
|
Reference in New Issue
Block a user