.net socket question


S

Silby

I've been messing around with sockets for a bit and i got most of it down (i
think).
The server side is an asynchronous tcp socket listener with sits and waits
for data.
The client side uses TcpClient to connect.
Connecting, sending and receiving data, error handling, ... all works fine.
The problem is when closing the connection.

Now as i understand it, closing the socket works as follows:
client -> tcp finish command
server -> acknowledges and sets its own finish command
client -> acknowledges again

What i do in code is just this
myTCPClient.close()
Which i think should handle all the internal commands to wrap up (right ?,
they are tpc sockets afterall). This results in the server socket going
into CLOSE_WAIT state, and the client socket going into FIN_WAIT_2 state.
They stay in that state until i close either the server or the client.
I tried making the async socket do a close command too, but that didnt
change anything at all.
I've searched through almost all the documentation i could find, but i must
still be missing something.

Could someone tell me what it is i still need to do to wrap up closing the
sockets ...
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

.Net Sockets 2
Socket Question. 1
Socket Question ? 4
.NET Sockets Help 1
Another sockets question 2
Email Sockets Question 1
General Sockets Question 2
Email Socket Question 15

Top