Re: Some network confusion
You need to create a TCP Listener object. If you search the forum you'll find plenty of examples (there's usually roughly one post a day on the subject!)
Also when you look at the code you have already, you'll see that your server is using a TCP Listener (hence its own ability to receive unsolicited messages). It is exactly the same principle for the client.
Re: Some network confusion
Thanks Paul. I've been reading a lot and messing around but I still haven't figured out what to do.
I think what I need to do is create a network stream, then have a listener function running in its own thread, and also have separate functions to send? Then have the listener loop until there is some data and do something with it? I'm just very confused as to how to go about it. Can I send while it's listening?
Any pointers would be much appreciated. I know this has probably been discussed before but in the searches I've done I haven't really found a way to apply this to make a solution.
Basically, I am just looking to find how to make a client that will:
1. Connect to a server
2. Be able to send commands.
3. Listen for incoming data, and if it gets it, do something with it. This data may be unsolicited.
Like I said, any help much appreciated. I'm still learning!
Re: Some network confusion
Nevermind, I found some references to BeginRead and followed up on that. Have it working now!