sockets blocking - nonblocking
Marc dirix <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <CAERi-x26HbHpOj=+VM+ALcvD4wHRdKCwk8MyOTJJ0h48WN2B+g@mail.gmail.com> |
Hi, I'm working on a client-server software that communicates over tcp/ip sockets. For the client the default operating mode is non-blocking however at some parts I need to synchronise requests and answers. For this I use "set_nonblocking_keep_callbacks()", then do a write and subsequent read on the socket. The write works just fine, the server receives the request, and tries to respond. However the read does not return any data (it just blocks). If I kill the server (probably causing the connection to close an then the read to return which causes the client to start nonblocking mode again, I suddenly receive the requested data. I've attached the code I'm using, I hope it is possible to make sense off it. The issue is in the function "write_blocking" in the communicator class. What can be wrong here? Best regards, Marc Dirix
InterCom.pike
(application/octet-stream, 5.8 KB) - not displayed