this is the quit code:
send(my_socket,(const char*)data,datasize,0):
the thread quit after this code, some minutes later which means that it send well in first some minutes.
printf("before");
send(my_socket,(const char*)data,datasize,0):
printf("after");
it will log out the "before"
and then the thread quit.
I have add some exception code
try catch(…){printf(“this is exception”);}
but nothing print out.it seems that there is no exception.
the thread is using std::thread.
std::thread thread([&]{
...do some code.
send(...)....
});
thread.detach();
1