Hi i found this site and this guy tries to teach you how to make a chat program. Well i just copied his code in and... th program worked. I can send a message to the server and it sends it back just fine. But i can only send a message once. If i try to send another message i get an error and it says this "A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll" then it "No connection could be made because the target machine actively refused it"

here is the link to the tutorial and code

7 Years
Discussion Span
Last Post by GeekByChoiCe

tcpclient.Close() <<< thats the reason
this code is made for demonstration only and closes after first receive.
You have to add some eventhandlers for client connect, receiving and so and only close the tcpclient if you really want it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.