Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        /// <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;
        }
Ejemplo n.º 3
0
 /// <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)
 {
 }
Ejemplo n.º 4
0
 /// <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)
 {
 }