public HttpSysListener(HttpSysOptions options, ILoggerFactory loggerFactory) { if (options == null) { throw new ArgumentNullException(nameof(options)); } if (loggerFactory == null) { throw new ArgumentNullException(nameof(loggerFactory)); } if (!HttpApi.Supported) { throw new PlatformNotSupportedException(); } Debug.Assert(HttpApi.ApiVersion == HttpApiTypes.HTTP_API_VERSION.Version20, "Invalid Http api version"); Options = options; Logger = loggerFactory.CreateLogger <HttpSysListener>(); _state = State.Stopped; _internalLock = new object(); // V2 initialization sequence: // 1. Create server session // 2. Create url group // 3. Create request queue // 4. Add urls to url group - Done in Start() // 5. Attach request queue to url group - Done in Start() try { _serverSession = new ServerSession(); _requestQueue = new RequestQueue(options.RequestQueueName, options.RequestQueueMode, Logger); _urlGroup = new UrlGroup(_serverSession, _requestQueue, Logger); _disconnectListener = new DisconnectListener(_requestQueue, Logger); } catch (Exception exception) { // If Url group or request queue creation failed, close server session before throwing. _requestQueue?.Dispose(); _urlGroup?.Dispose(); _serverSession?.Dispose(); Log.HttpSysListenerCtorError(Logger, exception); throw; } }
public void SetDisconnectEventListener(DisconnectListener callback) { disconnectCallback = callback; }
public ConnectionCancellation(DisconnectListener parent) { _parent = parent; }
public void RemoveDisconnectListener(DisconnectListener listener) { disconnectListeners.Remove(listener); }
public void AddDisconnectListener(DisconnectListener disconnectHandler) { disconnectListeners.Add(disconnectHandler); }
public void SetDisconnectEventListener(DisconnectListener callback) { rtClient.SetDisconnectEventListener(callback); }
public void SetDisconnectEventListener(DisconnectListener callback) { throw new NoSocketIOException(); }