public PhysicalBridge(ServerEndPoint serverEndPoint, ConnectionType type) { this.serverEndPoint = serverEndPoint; this.connectionType = type; this.multiplexer = serverEndPoint.Multiplexer; this.Name = Format.ToString(serverEndPoint.EndPoint) + "/" + connectionType.ToString(); this.completionManager = new CompletionManager(multiplexer, Name); }
public PhysicalBridge(ServerEndPoint serverEndPoint, ConnectionType type) { ServerEndPoint = serverEndPoint; ConnectionType = type; Multiplexer = serverEndPoint.Multiplexer; Name = Format.ToString(serverEndPoint.EndPoint) + "/" + ConnectionType.ToString(); completionManager = new CompletionManager(Multiplexer, Name); }
public PhysicalBridge(ServerEndPoint serverEndPoint, ConnectionType type, int timeoutMilliseconds) { ServerEndPoint = serverEndPoint; ConnectionType = type; Multiplexer = serverEndPoint.Multiplexer; Name = Format.ToString(serverEndPoint.EndPoint) + "/" + ConnectionType.ToString(); completionManager = new CompletionManager(Multiplexer, Name); TimeoutMilliseconds = timeoutMilliseconds; _singleWriterMutex = new MutexSlim(timeoutMilliseconds: timeoutMilliseconds); }
internal static void CompleteAsync(CompletionManager manager, ICompletable operation) { var sched = manager.multiplexer.SocketManager; if (sched != null) { sched.ScheduleTask(s_AnyOrderCompletionHandler, operation); Interlocked.Increment(ref manager.completedAsync); } else { SocketManager.Shared.ScheduleTask(s_AnyOrderCompletionHandler, operation); } }
internal static void CompleteSyncOrAsyncImpl(CompletionManager manager, ICompletable operation) { if (operation == null) { return; } if (manager != null) { manager.PerInstanceCompleteSyncOrAsync(operation); } else { SharedCompleteSyncOrAsync(operation); } }
/// <summary> /// Gets how many async completion workers were queueud /// </summary> public static long GetAsyncCompletionWorkerCount() { return(CompletionManager.GetAsyncCompletionWorkerCount()); }
public static void CompleteSyncOrAsync(this PhysicalBridge bridge, ICompletable operation) => CompletionManager.CompleteSyncOrAsyncImpl(bridge?.completionManager, operation);
public static void CompleteSyncOrAsync(this CompletionManager manager, ICompletable operation) => CompletionManager.CompleteSyncOrAsyncImpl(manager, operation);
/// <summary> /// Gets how many async completion workers were queueud /// </summary> public static long GetAsyncCompletionWorkerCount() => CompletionManager.GetAsyncCompletionWorkerCount();