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); }
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); }
public IReactor NewReactor(INode listenAddress) { var reactor = NewReactorInternal(listenAddress); reactor.Configure(Config); reactor.LocalEndpoint = listenAddress; if (ReceivedData != null) { reactor.OnReceive += (ReceivedDataCallback)ReceivedData.Clone(); } return(reactor); }