R
Robin Theilade
Hello,
I'm having some trouble creating an UDP socket that can listen on multiple
ports.
This is my code so far, it might give you a better idea of what I am trying
to accomplish. The problem using this code is when the Bind is called I get
a SocketException because the socket is already bound.
this.udpSocket = new Socket( AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp );
this.udpSocket.SetSocketOption( SocketOptionLevel.Socket,
SocketOptionName.ReuseAddress, 1 );
this.udpSocket.Bind( new IPEndPoint( IPAddress.Any, 7000 ) );
this.udpSocket.Bind( new IPEndPoint( IPAddress.Any, 7001 ) );
Any suggestions how to implement such a socket?
Best regards,
Robin Theilade
I'm having some trouble creating an UDP socket that can listen on multiple
ports.
This is my code so far, it might give you a better idea of what I am trying
to accomplish. The problem using this code is when the Bind is called I get
a SocketException because the socket is already bound.
this.udpSocket = new Socket( AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp );
this.udpSocket.SetSocketOption( SocketOptionLevel.Socket,
SocketOptionName.ReuseAddress, 1 );
this.udpSocket.Bind( new IPEndPoint( IPAddress.Any, 7000 ) );
this.udpSocket.Bind( new IPEndPoint( IPAddress.Any, 7001 ) );
Any suggestions how to implement such a socket?
Best regards,
Robin Theilade