// // Created by zx on 22-12-23. // #include #include #include "TCPClient.h" TCPClient tcp1,tcp2; void sig_exit(int s) { tcp1.exit(); tcp2.exit(); exit(0); } int main(int argc, char *argv[]) { signal(SIGINT, sig_exit); tcp1.setup("127.0.0.1",33000); tcp2.setup("127.0.0.1",34000); while(1) { //tcp.Send(argv[3]); string rec = tcp1.receive(); if( rec != "" ) { cout << rec << endl; } usleep(1000*1); } return 0; }