Esempio n. 1
0
 private Receive Accepting(IAssociationEventListener listener)
 {
     return message =>
     {
         var connected = message as Tcp.Connected;
         if (connected != null)
         {
             var actor = Context.ActorOf(Props.Create(() => new ConnectionAssociationActor(Sender)));
             var association = new ConnectionAssociationHandle(actor,
                 connected.LocalAddress.ToAddress(Context.System),
                 connected.RemoteAddress.ToAddress(Context.System));
             listener.Notify(new InboundAssociation(association));
         }
         return false;
     };
 }
Esempio n. 2
0
 private Receive Accepting(IAssociationEventListener listener)
 {
     return(message =>
     {
         var connected = message as Tcp.Connected;
         if (connected != null)
         {
             var actor = Context.ActorOf(Props.Create(() => new ConnectionAssociationActor(Sender)));
             var association = new ConnectionAssociationHandle(actor,
                                                               connected.LocalAddress.ToAddress(Context.System),
                                                               connected.RemoteAddress.ToAddress(Context.System));
             listener.Notify(new InboundAssociation(association));
         }
         return false;
     });
 }