Women in Technology

Hear us Roar



Article:
  Client/Server Rendezvous on the LAN
Subject:   Having multiple ServicePublisher on one pc not possible
Date:   2004-09-01 05:29:45
From:   DeepDiver
i tried to start multiple ServicePublishers on one machine and on the second ServicePublisher you get an exception :


Only one usage of each socket address (protocol/network address/port) is normally permitted


this happens in line 72
while calling :
this.listener = new UdpClient(UdpMulticastGroupSettings.ServerPort);



any solution on this available?

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Having multiple ServicePublisher on one pc not possible
    2004-09-01 06:32:28  DeepDiver [View]

    SOLUTION:

    in the ServiceProvider use AdvUdpClient instead of UdpClient

    impl for AdvUdpClient:

    public class AdvUdpClient : System.Net.Sockets.UdpClient
    {
    public AdvUdpClient( int port )
    {
    this.Client.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.ReuseAddress,1);
    this.Client.Bind( new IPEndPoint(IPAddress.Any, port) );
    }
    }