示例#1
0
 protected void Bind(UdpMultiplexer udpMux)
 {
     mux = udpMux;
     mux.SetPacketHandler(remote, ReceivedMessage);
 }
示例#2
0
 public override void Start()
 {
     if (Active) { return; }
     if (udpMultiplexer == null) { udpMultiplexer = new UdpMultiplexer(address, port); }
     udpMultiplexer.SetDefaultPacketHandler(PreviouslyUnseenUdpEndpoint);
     udpMultiplexer.Start();
 }
示例#3
0
 /// <summary>
 /// Create and configure a UDP handle for the specified demultiplexor.
 /// </summary>
 /// <param name="mux"></param>
 /// <param name="ep"></param>
 /// <returns></returns>
 public static UdpHandle Bind(UdpMultiplexer mux, EndPoint ep)
 {
     UdpHandle h = new UdpHandle(ep);
     h.Bind(mux);
     return h;
 }
示例#4
0
 public override void Dispose()
 {
     Stop();
     try { udpMultiplexer.Dispose(); }
     catch (Exception e) { log.Warn("exception disposing UDP listener", e); }
     udpMultiplexer = null;
 }