private void Handle(AcceptByTokenMessage m)
{
if (_isStopped)
return;
if (_initiator.CheckCreateChannel != null)
{
if (_initiator.CheckCreateChannel(m.Connection.RemoteEndPoint, m.Connection.Socket) == false)
{
m.Connection.Close();
return;
}
}
var channel = Context.ActorOf(Props.Create(() => new TcpChannel(_initiator, m.Connection, m.Tag, m.BindingActor)));
if (channel == null)
{
_logger?.TraceFormat("Deny a connection. (EndPoint={0})", m.Connection.RemoteEndPoint);
return;
}
_logger?.TraceFormat("Accept a connection. (EndPoint={0})", m.Connection.RemoteEndPoint);
Context.Watch(channel);
_channelSet.Add(channel);
}