Discussion:
socket programming using C in tandem
(too old to reply)
henchman
2007-07-06 04:06:17 UTC
Permalink
Simple socket programming using C in tandem. Using nowait procedures
and awaitiox to complete the nowait calls. I'm the sever side and
wanna know when a client side closes a connection. How to know this?
If I'm using a recv() the received data would be zero and from there
I'll know the client had closed their connection. But since I'm using
a recv_nw, how to know a connection had been closed? Help pls.
Alexi
2007-07-06 06:25:12 UTC
Permalink
Post by henchman
Simple socket programming using C in tandem. Using nowait procedures
and awaitiox to complete the nowait calls. I'm the sever side and
wanna know when a client side closes a connection. How to know this?
If I'm using a recv() the received data would be zero and from there
I'll know the client had closed their connection. But since I'm using
a recv_nw, how to know a connection had been closed? Help pls.
Hi,
this is simple: the AWAITIO call will complete on the recv_nw
operatiion (which should be uniquely identified by a tag). There will
be no error, but the countread parameter (indicating the number of
bytes read) will be zero.

Kind regards
Werner Alexi
alexi(at)alexi.de
henchman
2007-07-11 03:43:03 UTC
Permalink
Was only looking into recv_nw procedure to know whether the connection
has been closed or not, should use awaitiox it seems. Thanks alot
Werner Alexi, it really helped.

Loading...