TcpClient and Socket class

coolfire

Newcomer
Joined
Oct 6, 2003
Messages
14
Hi all,
how can i see if the TCPClient or Socket class really sent a stream and the server has really received the message? How can i see whether the connection between Client and Server(i'm the client) is still online?
Thx
 
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 :D


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 :)
 
Back
Top