this is the quit code:
<code>send(my_socket,(const char*)data,datasize,0):
</code>
<code>send(my_socket,(const char*)data,datasize,0):
</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.
<code>printf("before");
send(my_socket,(const char*)data,datasize,0):
printf("after");
</code>
<code>printf("before");
send(my_socket,(const char*)data,datasize,0):
printf("after");
</code>
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.
<code>std::thread thread([&]{
...do some code.
send(...)....
});
thread.detach();
</code>
<code>std::thread thread([&]{
...do some code.
send(...)....
});
thread.detach();
</code>
std::thread thread([&]{
...do some code.
send(...)....
});
thread.detach();
1