void Input_OnConnected(DeliveryConnection input) { DeliveryConnection output; #region get output while (true) { if (!outputQueue.TryDequeue(out output)) { break; } if (output.IsConnected) { break; } } #endregion if (output == null) { inputQueue.Enqueue(input); } else { input.Bind(output); //OutPut_SendStartMsg output.SendFrameAsync(StartMsg); Logger.Info($" [{output.GetHashCode()}] 转发成功"); } }
void ServerOnInputConnected(DeliveryConnection conn) { string RemoteEndPoint = null; try { RemoteEndPoint = conn.socket?.RemoteEndPoint.ToString(); client.Connect((conn2) => { conn.Bind(conn2); Logger.Info("转发成功[" + RemoteEndPoint + "]"); }); } catch (Exception ex) { Logger.Error("转发失败[" + RemoteEndPoint + "]", ex); } }