예제 #1
0
 public CreateServerFSM(RemoteConnection channel)
 {
     Channel = channel;
 }
예제 #2
0
 public static RemoteConnection CreateConnection(Role role, INode socketAddress, int poolSize, IHeliosConnectionHandler upstreamHandler)
 {
     if (role == Role.Client)
     {
         var connection = new ClientBootstrap().SetTransport(TransportType.Tcp)
             .SetOption("TcpNoDelay", true)
             .SetEncoder(Encoders.DefaultEncoder) //LengthFieldPrepender
             .SetDecoder(Encoders.DefaultDecoder) //LengthFieldFrameBasedDecoder
             .WorkerThreads(poolSize).Build().NewConnection(socketAddress);
         var remoteConnection = new RemoteConnection(connection, upstreamHandler);
         remoteConnection.Open();
         return remoteConnection;
     }
     else //server
     {
         var connection = new ServerBootstrap().SetTransport(TransportType.Tcp)
             .SetOption("TcpNoDelay", true)
             .SetEncoder(Encoders.DefaultEncoder) //LengthFieldPrepender
             .SetDecoder(Encoders.DefaultDecoder) //LengthFieldFrameBasedDecoder
             .WorkerThreads(poolSize).Build().NewConnection(socketAddress);
         var remoteConnection = new RemoteConnection(connection, upstreamHandler);
         remoteConnection.Open();
         return remoteConnection;
     }
 }
예제 #3
0
파일: Player.cs 프로젝트: wanglong/akka.net
 public Connected(RemoteConnection channel)
 {
     _channel = channel;
 }
예제 #4
0
파일: Player.cs 프로젝트: wanglong/akka.net
 private void Reconnect()
 {
     _nextAttempt = Deadline.Now + _backoff;
     RemoteConnection.CreateConnection(Role.Client, _server, _poolSize, this);
 }
예제 #5
0
파일: Player.cs 프로젝트: wanglong/akka.net
 public Data(RemoteConnection channel, Tuple <string, IActorRef> runningOp)
 {
     _channel   = channel;
     _runningOp = runningOp;
 }