/// <summary> /// 构造函数,带参数 /// </summary> /// <param name="receivePort"></param> /// <param name="sendPort"></param> /// <param name="totalClient"></param> public UdpServer(Int32 receivePort, Int32 sendPort, Int32 totalClient) { receivedData = new ReceiveSocket(receivePort); receivedData.OnDataReceived += new EventHandler <SocketAsyncEventArgs>(receivedData_OnDataReceived); sendData = new SendSocket(totalClient); sendData.OnDataSend += new EventHandler <SocketAsyncEventArgs>(sendData_OnDataSend); sendData.Init(); }
/// <summary> /// 构造函数,带参数 /// </summary> /// <param name="receivePort"></param> /// <param name="sendPort"></param> /// <param name="totalClient"></param> public UdpServer( Int32 receivePort, Int32 sendPort, Int32 totalClient ) { receivedData = new ReceiveSocket( receivePort ); receivedData.OnDataReceived += new EventHandler<SocketAsyncEventArgs>( receivedData_OnDataReceived ); sendData = new SendSocket( totalClient ); sendData.OnDataSend += new EventHandler<SocketAsyncEventArgs>( sendData_OnDataSend ); sendData.Init(); }
/// <summary> /// 构造函数,不带参数 /// 默认接收端口5555,发送端口4445,最在客户端数10000 /// </summary> public UdpServer() { this.receivePort = 5555; this.sendPort = 4445; this.maxClient = 10000; receivedData = new ReceiveSocket(receivePort); receivedData.OnDataReceived += new EventHandler <SocketAsyncEventArgs>(receivedData_OnDataReceived); sendData = new SendSocket(maxClient); sendData.OnDataSend += new EventHandler <SocketAsyncEventArgs>(sendData_OnDataSend); sendData.Init(); }
/// <summary> /// 构造函数,不带参数 /// 默认接收端口5555,发送端口4445,最在客户端数10000 /// </summary> public UdpServer() { this.receivePort = 5555; this.sendPort = 4445; this.maxClient = 10000; receivedData = new ReceiveSocket( receivePort ); receivedData.OnDataReceived += new EventHandler<SocketAsyncEventArgs>( receivedData_OnDataReceived ); sendData = new SendSocket( maxClient ); sendData.OnDataSend += new EventHandler<SocketAsyncEventArgs>( sendData_OnDataSend ); sendData.Init(); }