Beispiel #1
0
        /// <summary>
        ///server 启动端口连接
        /// </summary>
        /// <param name="port"></param>
        public async void Start(int port)
        {
            RpcConatiner.Initialize();
            DotNettyServer server = new DotNettyServer();
            await server.Listen(port);

            await Task.Factory.StartNew(async() =>
            {
                await server.Listen(port);
            });
        }
Beispiel #2
0
        /// <summary>
        ///server 启动端口连接
        /// </summary>
        /// <param name="port"></param>
        public async void Start(int port)
        {
            RpcConatiner.Initialize();
            //SyncTcpServer server = new SyncTcpServer();
            DotNettyServer server = new DotNettyServer();
            await server.Listen(port);

            // server.Handle += new RpcDefaultRequestHandler().Handle;
            await Task.Factory.StartNew(async() =>
            {
                await server.Listen(port);
            });
        }