コード例 #1
0
 public ServerTransportContract(ServerTransportManager manager) : base(manager)
 {
 }
コード例 #2
0
 /// <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)
 {
 }
コード例 #3
0
ファイル: RpcServer.cs プロジェクト: Indifer/Test
		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
			);
		}
コード例 #4
0
ファイル: RpcServer.cs プロジェクト: Indifer/Test
		/// <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;
		}
コード例 #5
0
ファイル: NullServerTransport.cs プロジェクト: Indifer/Test
		/// <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 ) { }
コード例 #6
0
		public ServerTransportContract( ServerTransportManager manager ) : base( manager ) { }