コード例 #1
0
ファイル: TcpTransport.cs プロジェクト: yildizoglu/akka.net
        void InitInbound(IChannel channel, IPEndPoint socketAddress, object msg)
        {
            // disable automatic reads
            channel.Configuration.AutoRead = false;

            _associationEventListener.ContinueWith(r =>
            {
                var listener      = r.Result;
                var remoteAddress = DotNettyTransport.MapSocketToAddress(
                    socketAddress: socketAddress,
                    schemeIdentifier: Transport.SchemeIdentifier,
                    systemName: Transport.System.Name);
                Init(channel, socketAddress, remoteAddress, msg, out var handle);
                listener.Notify(new InboundAssociation(handle));
            }, TaskContinuationOptions.OnlyOnRanToCompletion);
        }
コード例 #2
0
        protected void Init(IChannel channel, IPEndPoint remoteSocketAddress, Address remoteAddress, object msg,
                            out AssociationHandle op)
        {
            var localAddress = DotNettyTransport.MapSocketToAddress((IPEndPoint)channel.LocalAddress, Transport.SchemeIdentifier, Transport.System.Name, Transport.Settings.Hostname);

            if (localAddress != null)
            {
                var handle = CreateHandle(channel, localAddress, remoteAddress);
                handle.ReadHandlerSource.Task.ContinueWith(s =>
                {
                    var listener = s.Result;
                    RegisterListener(channel, listener, msg, remoteSocketAddress);
                    channel.Configuration.AutoRead = true; // turn reads back on
                }, TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted);
                op = handle;
            }
            else
            {
                op = null;
                channel.CloseAsync();
            }
        }
コード例 #3
0
ファイル: TcpTransport.cs プロジェクト: xiawei666/akka.net
 protected TcpHandlers(DotNettyTransport transport, ILoggingAdapter log) : base(transport, log)
 {
 }
コード例 #4
0
ファイル: TcpTransport.cs プロジェクト: xiawei666/akka.net
 public TcpAssociationHandle(Address localAddress, Address remoteAddress, DotNettyTransport transport, IChannel channel)
     : base(localAddress, remoteAddress)
 {
     _channel = channel;
 }
コード例 #5
0
ファイル: TcpTransport.cs プロジェクト: xiawei666/akka.net
 public TcpClientHandler(DotNettyTransport transport, ILoggingAdapter log, Address remoteAddress)
     : base(transport, log)
 {
     _remoteAddress = remoteAddress;
 }
コード例 #6
0
ファイル: TcpTransport.cs プロジェクト: xiawei666/akka.net
 public TcpServerHandler(DotNettyTransport transport, ILoggingAdapter log, Task <IAssociationEventListener> associationEventListener)
     : base(transport, log)
 {
     this._associationEventListener = associationEventListener;
 }
コード例 #7
0
 protected CommonHandlers(DotNettyTransport transport, ILoggingAdapter log)
 {
     Transport = transport;
     Log       = log;
 }