first you should just make a server which accepts everything then just open your ie and connect to your server
http://localhost:<port>/
then you should see anything at your server, after your server wont answer just click at the stop button and you will see what you get whenever a client closes the connection
after that just try to connect with your client to your server
now you tested everything
but: because i am a nice guy i will give you some extra hints
look in your msdn for an example for asynchronous server socket, there is also one for client, these two examples are just great to get started and fully work
at the Readcallback
there is a line which starts with int bytesRead = .... just do a try and catch around because here you will get the SocketException ( so catch the SocketException), which tells you that your client just said "bye" (
)
If you need more help on that topic, feel free to just reply with your questions