示例#1
0
        private void InitForClient()
        {
            serverForClient = new ServerNetworkManager();
            var server = new Plugins.Network.WebSocketServer();

            server.Setup("0.0.0.0", 8730);
            var serializer = new Plugins.ProtoSerializer();

            serializer.getTypeFunc = (name) => { return(Type.GetType(name)); };
            serializer.LoadProtoNum(typeof(Message.ProtoNum));
            serverForClient.Init(server, serializer);
            Debug.LogInfo("初始化网络监听(客户端) [{0}]", server.address);
        }
示例#2
0
        private void InitForClient()
        {
            forClient = new ServerNetworkManager();
            var listener = new Plugins.Network.WebSocketServer();

            listener.Setup("0.0.0.0", NetConfig.LISTENER_PORT);
            var serializer = new Plugins.ProtoSerializer();

            serializer.getTypeFunc = (name) => { return(Type.GetType(name)); };
            serializer.LoadProtoNum(typeof(Message.ProtoNum));
            forClient.Init(listener, serializer);
            Debug.LogInfo("初始化网络监听(客户端) [{0}]".FormatStr(listener.address));
        }