[Mono-list] UDP sockets and exceptions
dsmithers at talktalk.net
Mon Feb 4 09:34:21 EST 2008
I have a problem with my sockets.
I have a server application that opens a UDP socket on a specified port
and listens for client's requests.
I have a client application that I want to open a UDP socket choosing
from a range of ports. The client then listens at the socket for responses.
My problem is that if I run more than one client then they all end up
listening to the same socket.
All the sockets are configured using the same calls:
sock = new System.Net.Sockets.Socket(AddressFamily.InterNetwork,
IPEndPoint ep = new IPEndPoint(IPAddress.Any, port);
If I try to bind the client on to the server port then an exception is
System.Net.Sockets.SocketException Address already in use.
If I try to run more than one client then I do not get this exception.
Am I doing something wrong?
More information about the Mono-list