views:

227

answers:

3

how can i make a tcp (ive heard it called a listener?) server (simplicity is optional at this point) that can recieve data from a client thats connected as well as send data back to that individual client (more multiple clients)?

ive done several tutorials but i could not get any of them to work or they did not do what i was hoping they would do. anyway, any help is most appreciated.

+2  A: 

You could either manually use a Socket or for a more high level view, use TcpListener class.

Mehrdad Afshari
+3  A: 

There are samples all over the web, what is it that they are not doing dor you?

Basic sample

http://www.codeproject.com/KB/IP/socketsincsharp.aspx

Proper server sample

http://www.codeproject.com/KB/IP/AsyncSocketServerandClien.aspx

TFD
+2  A: 

Try this sample

This site is what I used when I needed to learn how to code a listener. Its fairly straight forward but a little more complicated than a lot of other samples out there. What exactly hasn't been working for you in the previous tutorials you tried?

Brandon
the most successful tutorial ive done would add each connected user to a new thread and cross threading with delegates just confused me to no end. i needed to be able to see what was going on at the servers end so adding things to the UI drove me insane as what worked for one thing didnt for another
Nyight