Hi all,
I am creating few nonblocking sockets using socket and ioctlsocket
function. Then using the setsockopt function I am enabling SO_LINGER
and specifying the timeout as 0.
Now after I call closesocket the function returns immediately, but the
connections are reset. This can be confirmed using netstat. I dont want
this to happen. I want the connection to be terminated immediately
after I call closesocket().
How can i achieve this? Is there any other way to terminate the
connections immediately? WINSOCk help says "If SO_LINGER is enabled
with a zero time-out: it always returns immediately -connection is
reset/terminated. " I guess in my case it is getting reset. How can I
set that to terminate?
To clear up things , My knowledge about reset and terminate is as
follows
When i say connection is reset : tht means a RST packet is send to the
destination.
Terminate : NO more packets are sent on this connection but it is
immediately closed.
Is this terminology correct?
Waiting for reply.
|