/// <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); }); }
/// <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); }); }