Register() public method

public Register ( IActorRef connection, SocketAsyncOperation initialOps ) : void
connection IActorRef
initialOps SocketAsyncOperation
return void
Esempio n. 1
0
            public void Register(SocketChannel channel, SocketAsyncOperation?initialOps, IActorRef channelActor)
            {
                channel.Register(channelActor, initialOps);

                if (initialOps.HasValue)
                {
                    EnableInterest(channel, initialOps.Value);
                }

                channelActor.Tell(new ChannelRegistration(
                                      enableInterest: op => EnableInterest(channel, op),
                                      disableInterest: op => DisableInterest(channel, op)
                                      ));
            }
Esempio n. 2
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;
        }
Esempio n. 3
0
        public void Register(SocketChannel channel, SocketAsyncOperation? initialOps, IActorRef channelActor)
        {
            
            channel.Register(channelActor, initialOps);

            RegisterCallReceiver.Ref.Tell(new TcpConnectionSpec.Registration(channel, initialOps));
        }