This repository has been archived on 2021-11-25. You can view files and clone it, but cannot push or open issues or pull requests.
BookFloatingServer/JsonTestSender.cpp
2017-03-09 12:22:12 +08:00

31 lines
448 B
C++

#include <cpplib/cpplib#gsock>
using namespace std;
char buff[1024];
void rcc(sock& s)
{
char tbuff[1024];
while(1)
{
memset(tbuff,0,1024);
s.recv(tbuff,1024);
printf("%s\n",tbuff);
}
}
int main()
{
sock s;
s.connect("123.206.86.73",55555);
thread td(rcc,ref(s));
td.detach();
while(1)
{
gets(buff);
strcat(buff,"\n");
s.send(buff,strlen(buff)+1);
}
}