public SaeaLayerCallback(ITransportLayerHandler handler, Socket listenSocket, Server server, int handlerId, ExecutionContextFlow contextFlow) { _handler = handler; _listenSocket = listenSocket; _server = server; _handlerId = handlerId; _contextSuppresser = ExecutionContextFlowSuppresser.CreateContextSuppresser(contextFlow); RecreateSaeas(); handler.Callback = this; }
public SaeaLayerCallback(ITransportLayerHandler handler, Socket listenSocket, Server server, int handlerId) { _handler = handler; _listenSocket = listenSocket; _server = server; _handlerId = handlerId; _receiveEvent.Completed += IoCompleted; _sendEvent.Completed += IoCompleted; _disconnectEvent.Completed += IoCompleted; _receiveEvent.DisconnectReuseSocket = true; _sendEvent.DisconnectReuseSocket = true; _disconnectEvent.DisconnectReuseSocket = true; _receiveEvent.UserToken = this; _sendEvent.UserToken = this; _disconnectEvent.UserToken = this; handler.Callback = this; }
public IDisposable Start() { var s = new Server(this); s.Start(); return s; }