예제 #1
0
 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }
예제 #5
0
 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);
     }
 }
예제 #8
0
 /// <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);
예제 #11
0
 /// <summary>
 /// Gets how many async completion workers were queueud
 /// </summary>
 public static long GetAsyncCompletionWorkerCount() => CompletionManager.GetAsyncCompletionWorkerCount();