Thanks Angus for the quick reply

In fact I am not exiting the thread but I am calling:


to break out of the socket MessageLoop

In doing so this sets the SslWSocket Terminated to true

And the next time I try to Send and therefore the next time I run the 
MessageLoop it immediately breaks out of the loop as it is doing a 
GetTermianted call which returns true!

Can I call SetTerminated(false) before calling Send/running the MEssageLoop?


Paul Read

Follow us: @nSolve <>

*nSolve Ltd*
33-35 Daws Lane
London NW7 4SD
England <>

Tel: +44 (0) 1993 40 20 11
Tel(US): +1 617 273 2304

On 28/07/2015 18:30, Angus Robertson - Magenta Systems Ltd wrote:
In a console app's thread, I make a valid connection, I call
SslWSocket->Send, followed by MessageLoop.
Once I receive OnDataSent message I call

And the data is sent and the control returns to the thread -

The second time I want to send data (without closing-reopening the
connection - which is not allowed by Apple) the MessageLoop
immediately returns as SetTerminated(TRUE) was called once the
MessageLoop was exited in the previous send.
*Question what is the correct way to use a SslWSocket to send data
over a continuously open connection?*
If I understand you correctly, you are exiting the thread after open and a 
send, which will close the connection.

You need to keep the thread running and send a message to it (or use a thread 
to pick something up) to send the next block.


To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to