I build a little chat with TcpClient and TcpListener.
All works fine, but my problem is when I close my server or my client.
I use BeginRead to listen an incoming message and I get IO exception immediately after my form closing.
So, it seems that server and client always communicate with each other(always connected).
Could you tell me if I'm right ? If so, does it use a lot of bandwith because I'd like to deploy my app from internet.
Is there a way to only listen incoming message ? I mean the client listens incoming message internally (sort of disconnected communication): for example, the server sends a message to the client message box and the client only listens to incoming messages in message box without always asking to the server. I think it's possible to do.
Thanks in advance for helping me.