/// <summary> /// new /// </summary> /// <param name="port"></param> /// <param name="messageBufferSize"></param> /// <param name="receiveThreads"></param> /// <param name="protocol"></param> /// <param name="service"></param> /// <exception cref="ArgumentOutOfRangeException"></exception> /// <exception cref="ArgumentNullException">protocol is null.</exception> /// <exception cref="ArgumentNullException">service is null.</exception> public UdpServer(int port, int messageBufferSize, int receiveThreads, IUdpProtocol protocol, IUdpServerHandler handler) { if (receiveThreads < 1) throw new ArgumentOutOfRangeException("receiveThreads"); if (protocol == null) throw new ArgumentNullException("protocol"); if (handler == null) throw new ArgumentNullException("handler"); this._port = port; this._messageBufferSize = messageBufferSize; this._receiveThreads = receiveThreads; this._protocol = protocol; this._handler = handler; }
/// <summary> /// new /// </summary> /// <param name="port"></param> /// <param name="messageBufferSize"></param> /// <param name="receiveThreads"></param> /// <param name="protocol"></param> /// <param name="service"></param> /// <exception cref="ArgumentOutOfRangeException"></exception> /// <exception cref="ArgumentNullException">protocol is null.</exception> /// <exception cref="ArgumentNullException">service is null.</exception> public UdpServer(int port, int messageBufferSize, int receiveThreads, IUdpProtocol protocol, IUdpServerHandler handler) { if (receiveThreads < 1) { throw new ArgumentOutOfRangeException("receiveThreads"); } if (protocol == null) { throw new ArgumentNullException("protocol"); } if (handler == null) { throw new ArgumentNullException("handler"); } this._port = port; this._messageBufferSize = messageBufferSize; this._receiveThreads = receiveThreads; this._protocol = protocol; this._handler = handler; }
/// <summary> /// new /// </summary> /// <param name="port"></param> /// <param name="protocol"></param> /// <param name="service"></param> public UdpServer(int port, IUdpProtocol protocol, IUdpServerHandler handler) : this(port, 2048, 1, protocol, handler) { }