Beispiel #1
0
        public IConnection NewConnection(INode localEndpoint, INode remoteEndpoint)
        {
            var connection = CreateConnection(localEndpoint, remoteEndpoint);

            connection.Configure(Config);

            if (ReceivedData != null)
            {
                connection.Receive += (ReceivedDataCallback)ReceivedData.Clone();
            }
            if (ConnectionEstablishedCallback != null)
            {
                connection.OnConnection += (ConnectionEstablishedCallback)ConnectionEstablishedCallback.Clone();
            }
            if (ConnectionTerminatedCallback != null)
            {
                connection.OnDisconnection += (ConnectionTerminatedCallback)ConnectionTerminatedCallback.Clone();
            }
            if (ExceptionCallback != null)
            {
                connection.OnError += (ExceptionCallback)ExceptionCallback.Clone();
            }

            return(connection);
        }
Beispiel #2
0
        public IReactor NewReactor(INode listenAddress)
        {
            var reactor = NewReactorInternal(listenAddress);

            reactor.Configure(Config);

            if (ReceivedData != null)
            {
                reactor.OnReceive += (ReceivedDataCallback)ReceivedData.Clone();
            }
            if (ConnectionEstablishedCallback != null)
            {
                reactor.OnConnection += (ConnectionEstablishedCallback)ConnectionEstablishedCallback.Clone();
            }
            if (ConnectionTerminatedCallback != null)
            {
                reactor.OnDisconnection += (ConnectionTerminatedCallback)ConnectionTerminatedCallback.Clone();
            }
            if (ExceptionCallback != null)
            {
                reactor.OnError += (ExceptionCallback)ExceptionCallback.Clone();
            }

            return(reactor);
        }
Beispiel #3
0
 public new ClientBootstrap OnDisconnect(ConnectionTerminatedCallback connectionTerminatedCallback)
 {
     base.OnDisconnect(connectionTerminatedCallback);
     return(this);
 }
Beispiel #4
0
 public new ClientBootstrap OnDisconnect(ConnectionTerminatedCallback connectionTerminatedCallback)
 {
     base.OnDisconnect(connectionTerminatedCallback);
     return this;
 }
 public virtual AbstractBootstrap OnDisconnect(ConnectionTerminatedCallback connectionTerminatedCallback)
 {
     ConnectionTerminatedCallback = connectionTerminatedCallback;
     return(this);
 }
 public virtual AbstractBootstrap OnDisconnect(ConnectionTerminatedCallback connectionTerminatedCallback)
 {
     ConnectionTerminatedCallback = connectionTerminatedCallback;
     return this;
 }