Re: [twsocket] Sending data from multiple threads on SSL doesn't work

2018-10-04 Thread Angus Robertson - Magenta Systems Ltd
> It happens if I'm sending from a thread or even only from the > main thread (from a timer), please check this demo app: I look very briefly at your demo, it uses the non-thread aware socket server, and creates one single thread to send data to all clients, with no locking attempts or even a

Re: [twsocket] Sending data from multiple threads on SSL doesn't work

2018-10-04 Thread Angus Robertson - Magenta Systems Ltd
> I didn't change any ICS code, but only my derived class... do you > think that by always adding to the send buffer PutDataInSendBuffer) > and posting FD_WRITE instead of calling TryToSend could cause any > issues? There are often several ways of doing something, if extensive testing does not

Re: [twsocket] Sending data from multiple threads on SSL doesn't work

2018-10-03 Thread Éric Fleming Bonilha
I understand But non-threaded is not an option.. our application is a high performance video management system, it must be multi-threaded, in fact we have a very highly threaded architecture, and it would create huge bottlenecks making it single threaded (for network message processing). This

Re: [twsocket] Sending data from multiple threads on SSL doesn't work

2018-10-03 Thread Éric Fleming Bonilha
Angus Funny thing, when the error happens, getlasterror from SSL returns: error:1408F10B:SSL routines:ssl3_get_record:wrong version number The disconnection is easily reproduceable by spawning a few threads Eric On Wed, Oct 3, 2018 at 2:01 PM Éric Fleming Bonilha wrote: > Angus > > I'm

Re: [twsocket] Sending data from multiple threads on SSL doesn't work

2018-10-03 Thread Éric Fleming Bonilha
Hi Angus Thanks for the reply. This is indeed a strange problem, because there's no deadlock or locking problem, and the problem does not happen in a deterministic way.. its kind of random, so I have to keep it running for a few seconds or minutes, then it will stop, maybe when a certain

Re: [twsocket] Sending data from multiple threads on SSL doesn't work

2018-10-03 Thread Angus Robertson - Magenta Systems Ltd
> I understand that ICS is thread safe when sending data because > adding and removing data to send buffers are locked with critical > sections.. but maybe OpenSSL does not like when we send data > from two different threads? OpenSSL is thread safe, or at least has been in the past, I've tested