Archived Forum Post

Index of archived forum posts

Question:

Closing socket from separate thread

Mar 29 '13 at 13:28

Application was designed to use sync sockets (I assume it is blocking sockets). There is a separate thread to receive data and another thread to send data. Thread that receiving data always hangs on read something.

The problem is when you try to send something at the same time when you receive data I have a crash. The same is when I want to close socket during receiving data.

So What should I do to avoid such situation when I try to send data and read at the same time. Is in CkSocket any method to ask socket if it is not blocked.

Maybe you know better approach how to synchronize sockets for such operations.

PS: OS is iOS. Sockets is on c++ Last Error in different cases shows different log.