public static void AddConnection(RpcTcpSimplexConnectionWrapper wrapper) { lock (_syncRoot) { _tracing.InfoFmt("add connection {0}", wrapper.GetInfo()); _connections.Add(wrapper, 0); } }
public RpcTcpSimplexConnection(RpcTcpClientChannel channel, TcpUri serverUri, int concurrentConnection) : base(RpcConnectionMode.Simplex, RpcConnectionDirection.Client) { _channel = channel; _serverUri = serverUri; _connections = new RpcTcpSimplexConnectionWrapper[concurrentConnection]; _lc = new LoopCounter(concurrentConnection); _connectionCount = new ComboClass <int>(0); for (int i = 0; i < concurrentConnection; i++) { var wrapper = new RpcTcpSimplexConnectionWrapper(this); RpcTcpSimplexConnectionManager.AddConnection(wrapper); _connections[i] = wrapper; } }
public static void RemoveConnection(RpcTcpSimplexConnectionWrapper wrapper) { lock (_syncRoot) { _connections.Remove(wrapper); } }