public void Init() { Client = new UDPThread(_config); MessageProxy = new MsgTranslator(Client, this._config); //与接收消息进行挂钩 MessageProxy.MessageReceived += MessageProxy_MessageReceived; }
public MsgTranslator(UDPThread udpClient, Config config) { this.Client = udpClient; this._config = config; ReceivedQueue = new Queue <long>(); Client.PackageReceived += PackageReceived; }