C# TCP Client/Server communication issue

Posted by Jamie on Stack Overflow See other posts from Stack Overflow or by Jamie
Published on 2010-05-29T22:41:58Z Indexed on 2010/05/29 22:42 UTC
Read the original article Hit count: 214

Filed under:

What i'm currently trying to do is make a very basic webchat for irc using silverlight.

Basically how i'm trying to do it is have a tcp server listening for connections from silverlight. When a client connects it creates a new connection to irc and data is passed to/from the client/irc via the server application.

I've gotten it to work fine for one client connection, but as soon as two (or more) clients connect multiple connections are made to irc but all data passed from the clients just goes through the latest irc connection (if that makes sense).

For example Client1, Client2 and Client3 are all connected to irc, but no matter who sends data it all comes through Client3.

Between the client and server app it recongises the data coming in from different clients so i believe the problems lies within the way i've connected to the irc. When the TCP server accepts a new client a new thread is made to listen to incoming data, and from there a new thread is made to connect to irc. I'm sure thats where the problem exists, but i've confused myself a lot now and am wondering if anyone can help me figure out a solution.

© Stack Overflow or respective owner

Related posts about c#