Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        void Output_OnReceiveStartMsg(DeliveryConnection output, ArraySegment <byte> data)
        {
            StartNewOutput();

            localClient.Connect((local) =>
            {
                try
                {
                    if (data.Count != 0)
                    {
                        local.SendFrameAsync(data);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                }
                local.Bind(output);
            });
        }
Esempio n. 3
0
 void StartNewOutput()
 {
     outputClient.Connect(Output_OnConnected);
 }