0
votes

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 recognizes 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.

EDIT: What I think is the problem, is that it can't distinguish which thread the specific client is using, so it just sends it via the latest one. Can this even be done?

1
Welcome to SO. Please don't duplicate "C#" in the title and in the tags. Besides, your problem is with .NET, not with the C# programming language.John Saunders
You probably should post some of the key code.m0s

1 Answers

0
votes

It seems that the server is opening sockets only to the last connection made. Maybe if you try and process the message on the server and open a socket to the client it might work.