/// <summary> /// Initializes a new instance of the <see cref="UdpHelperState"/> class. /// </summary> /// <param name="mode">The mode.</param> /// <param name="socket">The socket.</param> public State(UdpHelperMode mode, Socket socket) { Mode = mode; Buffer = Mode != UdpHelperMode.Sender ? (new byte[UDPMAXSIZE]) : null; Socket = socket; mIPAddressExclude = new HashSet <IPAddress>(); }
/// <summary> /// Initializes a new instance of the <see cref="UdpHelper"/> class. /// </summary> public UdpHelper(UdpConfig udp, UdpHelperMode mode) { Config = udp; Mode = mode; mConnectionsListener = new Dictionary <IPEndPoint, State>(); mConnectionsSender = new Dictionary <IPEndPoint, State>(); mIncomingPending = new ConcurrentQueue <Message>(); }