public TcpIncomingConnection(TcpExt tcp, 
                                     SocketChannel channel, 
                                     IChannelRegistry registry, 
                                     IActorRef bindHandler,
                                     IEnumerable<Inet.SocketOption> options, 
                                     bool readThrottling)
            : base(tcp, channel, readThrottling)
        {
            _bindHandler = bindHandler;
            _options = options;

            Context.Watch(bindHandler); // sign death pact

            registry.Register(channel, SocketAsyncOperation.None, Self);
        }
Example #2
0
 public FailedRegisterIncoming(SocketChannel channel)
 {
     Channel = channel;
 }
Example #3
0
        internal SocketChannel AcceptServerSideChannel(SocketChannel localServer)
        {
            var promise = new TaskCompletionSource<Socket>();
            var task = promise.Task;

            localServer.Socket.Listen(100);
            localServer.Socket.BeginAccept(ar => promise.SetResult(localServer.Socket.EndAccept(ar)), null);

            Selector.Send(ConnectionActor, SelectionHandler.ChannelConnectable.Instance);

            task.Wait();

            var channel = new SocketChannel(task.Result);
            channel.Register(ChannelProbe, SocketAsyncOperation.None);
            return channel;
        }
Example #4
0
 public Registration(SocketChannel channel, SocketAsyncOperation? initialOps)
 {
     Channel = channel;
     InitialOps = initialOps;
 }
Example #5
0
        public void Register(SocketChannel channel, SocketAsyncOperation? initialOps, IActorRef channelActor)
        {
            
            channel.Register(channelActor, initialOps);

            RegisterCallReceiver.Ref.Tell(new TcpConnectionSpec.Registration(channel, initialOps));
        }
Example #6
0
        public void AbortClose(SocketChannel channel)
        {
            // TODO: Do we need to handle expection like JVM?

            channel.Socket.LingerState = new LingerOption(true, 0);
            channel.Close();
        }
Example #7
0
 public void Register(SocketChannel channel, SocketAsyncOperation? initialOps, IActorRef channelActor)
 {
     _test._registerCallReceiver.Ref.Tell(initialOps, channelActor);
 }