Akka.Interfaced.SlimSocket.Server.TcpGateway.Handle C# (CSharp) Method

Handle() private method

private Handle ( AcceptMessage m ) : void
m AcceptMessage
return void
        private void Handle(AcceptMessage m)
        {
            if (_isStopped)
                return;

            if (_initiator.CheckCreateChannel != null)
            {
                if (_initiator.CheckCreateChannel(m.Socket.RemoteEndPoint, m.Socket) == false)
                {
                    m.Socket.Close();
                    return;
                }
            }

            if (_initiator.TokenRequired)
            {
                Context.ActorOf(Props.Create(() => new TokenChecker(_initiator, this, m.Socket)));
            }
            else
            {
                var channel = Context.ActorOf(Props.Create(() => new TcpChannel(_initiator, m.Socket, null)));
                if (channel == null)
                {
                    _logger?.TraceFormat("Deny a connection. (EndPoint={0})", m.Socket.RemoteEndPoint);
                    return;
                }

                _logger?.TraceFormat("Accept a connection. (EndPoint={0})", m.Socket.RemoteEndPoint);

                Context.Watch(channel);
                _channelSet.Add(channel);
            }
        }

Same methods

TcpGateway::Handle ( AcceptByTokenMessage m ) : void
TcpGateway::Handle ( Terminated m ) : void
TcpGateway::Handle ( TimeoutTimerMessage m ) : void