Exemple #1
0
 protected override void Ready(object message)
 {
     message.Match()
     .With <InboundAssociation>(ia =>    //need to create an Inbound ProtocolStateActor
     {
         var handle = ia.Association;
         var stateActorLocalAddress        = localAddress;
         var stateActorAssociationListener = associationListener;
         var stateActorSettings            = _settings;
         var failureDetector = CreateTransportFailureDetector();
         Context.ActorOf(RARP.For(Context.System).ConfigureDispatcher(ProtocolStateActor.InboundProps(
                                                                          new HandshakeInfo(stateActorLocalAddress, AddressUidExtension.Uid(Context.System)),
                                                                          handle,
                                                                          stateActorAssociationListener,
                                                                          stateActorSettings,
                                                                          new AkkaPduProtobuffCodec(),
                                                                          failureDetector)), ActorNameFor(handle.RemoteAddress));
     })
     .With <AssociateUnderlying>(au => CreateOutboundStateActor(au.RemoteAddress, au.StatusPromise, null))    //need to create an Outbound ProtocolStateActor
     .With <AssociateUnderlyingRefuseUid>(au => CreateOutboundStateActor(au.RemoteAddress, au.StatusCompletionSource, au.RefuseUid));
 }
Exemple #2
0
 protected override void Ready(object message)
 {
     message.Match()
     .With <InboundAssociation>(ia =>    //need to create an Inbound ProtocolStateActor
     {
         var handle = ia.Association;
         var stateActorLocalAddress        = localAddress;
         var stateActorAssociationListener = associationListener;
         var stateActorSettings            = _settings;
         var failureDetector = CreateTransportFailureDetector();
         //TODO: eventually this needs to be configured with the RemoteDispatcher via https://github.com/akka/akka/blob/f1edf789798dc02dfa37d3301d7712736c964ab1/akka-remote/src/main/scala/akka/remote/transport/AkkaProtocolTransport.scala#L156
         Context.ActorOf(ProtocolStateActor.InboundProps(
                             new HandshakeInfo(stateActorLocalAddress, AddressUidExtension.Uid(Context.System)),
                             handle,
                             stateActorAssociationListener,
                             stateActorSettings,
                             new AkkaPduProtobuffCodec(),
                             failureDetector), ActorNameFor(handle.RemoteAddress));
     })
     .With <AssociateUnderlying>(au => CreateOutboundStateActor(au.RemoteAddress, au.StatusPromise, null))    //need to create an Outbond ProtocolStateActor
     .With <AssociateUnderlyingRefuseUid>(au => CreateOutboundStateActor(au.RemoteAddress, au.StatusCompletionSource, au.RefuseUid));
 }