阅读背景:

lidgren 介绍和使用 (三)------ 异步获取信息

来源:互联网 
        NetPeerConfiguration config1 = new NetPeerConfiguration("chat");//参数是一个字符串标识,前后端一致。
            config1.AutoFlushSendQueue = false;
            //    config1.EnableMessageType(NetIncomingMessageType.ConnectionLatencyUpdated);//监听收发心跳的事件。
            s_client = new NetClient(config1);
            s_client.Start();
            SendOrPostCallback m_receiveCallBack = new SendOrPostCallback(OnReceiveMessage);//收发消息的回调
            s_client.RegisterReceivedCallback(m_receiveCallBack, new SynchronizationContext());
            NetOutgoingMessage hail = s_client.CreateMessage("This is the hail message");
            s_client.Connect("103.200.30.194", 14242, hail);
        NetPeerConfiguration config1 = new 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: