public override void Init() { instance = this; if (msgIDs == null) { msgIDs = new CMessageID(); } sendStack = new Stack <SendCallback>(); msgBuilders = new List <FlatBufferBuilder>(builderLimit) { }; for (int i = 0; i < builderLimit; i++) { msgBuilders.Add(new FlatBufferBuilder(32)); } csocket = new CSocket(); csocket.Init(); // //udp相关 updSocket = new CSocketUDP(); updSocket.Init(); updSocket.BeginReceive(); CConstVar.LocalPort = updSocket.GetLocalPort(); //loopback loopbacks = new Loopback[2]; //队列 sendPacketQueue = new CircularBuffer <PacketQueue>(10); needUpdate = true; // HuffmanMsg.Init(); }
public override void Dispose() { csocket.Dipose(); updSocket.Dispose(); csocket = null; updSocket = null; }