public void Init() { Packet = new SortedDictionary <int, byte[]>(); PacketProxy = new PacketProxy(); UdpHandler = UdpProtoHandler.Ins; //注册解析udp数据包. UdpHandler.RegisterPacket(Packet); }
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); } }