예제 #1
0
 protected override bool Receive(object m)
 {
     return(WorkerForCommandHandler(message =>
     {
         var c = message as UdpConnected.Connect;
         if (c != null)
         {
             var commander = Sender;
             return registry => Props.Create(() => new UdpConnection(_udpConn, registry, commander, c));
         }
         throw new ArgumentException("The supplied message type is invalid. Only Connect messages are supported.");
     })(m));
 }
예제 #2
0
 protected override bool Receive(object m)
 {
     return(WorkerForCommandHandler(message =>
     {
         var b = message as Udp.Bind;
         if (b != null)
         {
             var commander = Sender;
             return registry => Props.Create(() => new UdpListener(_udp, registry, commander, b));
         }
         var s = message as Udp.SimpleSender;
         if (s != null)
         {
             var commander = Sender;
             return registry => Props.Create(() => new UdpSender(_udp, registry, commander, s.Options));
         }
         throw new ArgumentException("The supplied message type is invalid. Only Bind and SimpleSender messages are supported.");
     })(m));
 }
예제 #3
0
 protected override bool Receive(object m)
 {
     return(WorkerForCommandHandler(message =>
     {
         var c = message as Tcp.Connect;
         if (c != null)
         {
             var commander = Sender;
             return registry => Props.Create(() => new TcpOutgoingConnection(_tcp, registry, commander, c));
         }
         var b = message as Tcp.Bind;
         if (b != null)
         {
             var commander = Sender;
             return registry => Props.Create(() => new TcpListener(SelectorPool, _tcp, registry, commander, b));
         }
         throw new ArgumentException("The supplied message type is invalid. Only Connect and Bind messages are supported.");
     })(m));
 }