Add 'JsonTestSender.cpp'
This commit is contained in:
parent
fbf38130d7
commit
b6e07fabdd
30
JsonTestSender.cpp
Normal file
30
JsonTestSender.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user