Socket Chat?!
-
Hey folks.. :) Im new with socket-programming and I wanna program a simple server/client-chat. You start a server client to listen for connection from clients.. Then it should be possible to send text to and from the clients. Im gonna need only a very simple but working example.. :) I also searched this site but I couldn't run the apps.. got errors so on. But I have dotNet 1.1 of course.. :) So help me out here, thanks! :-D
- Up The Irons, Morten Kristensen
-
Hey folks.. :) Im new with socket-programming and I wanna program a simple server/client-chat. You start a server client to listen for connection from clients.. Then it should be possible to send text to and from the clients. Im gonna need only a very simple but working example.. :) I also searched this site but I couldn't run the apps.. got errors so on. But I have dotNet 1.1 of course.. :) So help me out here, thanks! :-D
- Up The Irons, Morten Kristensen
For .NET development - if you don't plan on supporting clients using other technologies - you may want to look at .NET Remoting instead. It is a much more powerful, more flexible technology and takes care of the communications automatically. The simplest designer just uses a shared assembly which defines interfaces that the server implements and that the clients user to communicate with the server through a proxy. When using the
TcpChannel
provided by the .NET Framework Class Library (FCL), you can even have events so that when a client sends a message to the server an event is raised and other clients can get the message immediately. If you're writing your own socket-based chat, you have to handle all this yourself. In such a case, you need to keep track of connected clients (which .NET Remoting can also do for you pretty easily, though you could use something similar to...) by storing them in a list or something and associate them to each other were appropriate. If you're having problems with the applications you've found on this site, then you should be specific about what those problems are and you should post questions on the articles' message boards since they're specific to that article.Microsoft MVP, Visual C# My Articles
-
For .NET development - if you don't plan on supporting clients using other technologies - you may want to look at .NET Remoting instead. It is a much more powerful, more flexible technology and takes care of the communications automatically. The simplest designer just uses a shared assembly which defines interfaces that the server implements and that the clients user to communicate with the server through a proxy. When using the
TcpChannel
provided by the .NET Framework Class Library (FCL), you can even have events so that when a client sends a message to the server an event is raised and other clients can get the message immediately. If you're writing your own socket-based chat, you have to handle all this yourself. In such a case, you need to keep track of connected clients (which .NET Remoting can also do for you pretty easily, though you could use something similar to...) by storing them in a list or something and associate them to each other were appropriate. If you're having problems with the applications you've found on this site, then you should be specific about what those problems are and you should post questions on the articles' message boards since they're specific to that article.Microsoft MVP, Visual C# My Articles
Thank you Heart! :) Im gonna try the Remoting thing then :)
- Up The Irons, Morten Kristensen