コード例 #1
0
 public void Start()
 {
     mcastHost = new MulticastHost(localEndpoint);
     mcastHost.MessageReceived += mcastHost_MessageReceived;
     mcastHost.Start();
     mcastHost.Send(serverEndpoint, new RegisterMessage()
     {
         Sender = localEndpoint
     });
 }
コード例 #2
0
 public void Stop()
 {
     if (mcastHost != null)
     {
         mcastHost.Send(serverEndpoint, new UnregisterMessage()
         {
             Sender = localEndpoint
         });
         mcastHost.Dispose();
         mcastHost = null;
     }
 }