コード例 #1
0
ファイル: UdpClientProxy.cs プロジェクト: WeeirJoe/Joe
 public void Init()
 {
     Packet      = new SortedDictionary <int, byte[]>();
     PacketProxy = new PacketProxy();
     UdpHandler  = UdpProtoHandler.Ins;
     //注册解析udp数据包.
     UdpHandler.RegisterPacket(Packet);
 }
コード例 #2
0
    public static void ReStart()
    {
        quit = false;

        if (sProxy == null)
        {
            sProxy = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        }

        if (proxy == null)
        {
            proxy = new PacketProxy();
        }

        InitServerCfg();
        if (tConn == null)
        {
            tConn = new Timer(TryConn, null, 0, 5000);
        }
    }