public ServerTransportContract(ServerTransportManager manager) : base(manager) { }
/// <summary> /// Initializes a new instance of the <see cref="NullServerTransport"/> class. /// </summary> /// <param name="manager">The manager.</param> public NullServerTransport(ServerTransportManager <NullServerTransport> manager) : base(manager) { }
private void Stop() { var currentDispatcher = Interlocked.Exchange( ref this._dispatcher, null ); if ( currentDispatcher == null ) { return; } if ( Interlocked.Exchange( ref _state, 1 ) != 0 ) { return; } if ( this._transportManager != null ) { using ( var tracker = new ShutdownTracker() ) { this._transportManager.ShutdownCompleted += tracker.OnTransportManagerShutdownCompleted; try { if ( this._transportManager.BeginShutdown() ) { tracker.Wait(); } } finally { this._transportManager.ShutdownCompleted -= tracker.OnTransportManagerShutdownCompleted; } } this._transportManager.Dispose(); this._transportManager = null; } MsgPackRpcServerTrace.TraceEvent( MsgPackRpcServerTrace.StopServer, "Stop server. {{ \"Configuration\" : {0}, \"Id\" : \"{1}\" }}", this._configuration, this ); }
/// <summary> /// Starts the server stack. /// </summary> /// <returns> /// <c>true</c> if the server starts operation; otherwise, <c>false</c>. /// If the server is already started, this method returns <c>false</c>. /// </returns> public bool Start() { if ( Interlocked.CompareExchange( ref this._state, 0, 0 ) != 0 ) { throw new ObjectDisposedException( this.ToString() ); } var currentDispatcher = Interlocked.CompareExchange( ref this._dispatcher, this._configuration.DispatcherProvider( this ), null ); if ( currentDispatcher != null ) { return false; } MsgPackRpcServerTrace.TraceEvent( MsgPackRpcServerTrace.StartServer, "Start server. {{ \"Configuration\" : {0}, \"Id\" : \"{1}\" }}", this._configuration, this ); this._transportManager = this._configuration.TransportManagerProvider( this ); return true; }
/// <summary> /// Initializes a new instance of the <see cref="NullServerTransport"/> class. /// </summary> /// <param name="manager">The manager.</param> public NullServerTransport( ServerTransportManager<NullServerTransport> manager ) : base( manager ) { }
public ServerTransportContract( ServerTransportManager manager ) : base( manager ) { }