Home » U++ Library support » U++ MT-multithreading and servers » SSL server crash
Re: SSL server crash [message #33726 is a reply to message #33725] |
Thu, 08 September 2011 20:42   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
Zbych wrote on Thu, 08 September 2011 10:33 | Hi,
I have a problem with a simple SSL server on linux. After connecting a few clients (for example 5), I start killing them one by one. Server should just close connections, but it crashes inside SetSockError:
void Socket::SetSockError(SOCKET socket, const char *context, int code, const char *errdesc)
{
String err;
errorcode = code;
if(socket != INVALID_SOCKET)
err << "socket(" << (int)socket << ") / ";
err << context << ": " << errdesc;
errordesc = err; //<------------ crash
is_error = true;
SetErrorText(err);
}
The question is what I am doing wrong? Maybe I shouldn't use vector in two different threads without protection?
|
Not sure if that is the cause, but you definitiely should NOT do client.Add in one thread and client.Remove in another, you need mutex serialization for that...
Mirek
|
|
|
Goto Forum:
Current Time: Tue Aug 26 01:43:29 CEST 2025
Total time taken to generate the page: 0.00630 seconds
|