pomelo-unityclient-socketPomelo 的 .NET 客户端
pomelo-unityclient-socket 是 Pomelo 的 .NET 客户端,支持 Pomelo 0.3和新的交流协议,基于原生的 Socket。
示例
API
初始化
using namespace Pomelo.DotNetClient string host="127.0.0.1";//(www.xxx.com/127.0.0.1/::1/localhost etc.) int port=3014; PomeloClient pclient = new PomeloClient(); //listen on network state changed event pclient.NetWorkStateChangedEvent += (state) => { Console.WriteLine(state); }; pclient.initClient(host, port, () => { //The user data is the handshake user params JsonObject user = new JsonObject(); pclient.connect(user, data => { //process handshake call back data }); });
评论