rome ez wrote:
I am trying to write a vb.net socket application which listens for clients on two ports simultaneously. Is it possible to do so and how can this be done.
Please help.
If you can do it with one, you can do it with two. You instantiate a socket (or
more likely a TcpListener), start it listening. Then repeat.
Typically there is some kind of while loop involved with listening for client
connections. So my personal approach would be to create a class which manages
each socket within its own thread. (A plus which may or may not matter to you
is that you then have the option within your loop to use the simple synchronous
methods which block immediately, such as AcceptSocket().) But what have you
actually tried that is not working and where does the difficulty occur?
(This is not a VB news group, however. Examples you get here will most likely
be in C#. If your problem is syntax related you might consider moving to a VB
group.)
Hope this helps,
-rick-