NetworkCommsDotNet.Connections.UDP.UDPConnectionListener.UDPConnectionListener C# (CSharp) Method

UDPConnectionListener() public method

Create a new instance of a UDP listener
public UDPConnectionListener ( SendReceiveOptions sendReceiveOptions, ApplicationLayerProtocolStatus applicationLayerProtocol, UDPOptions udpOptions, bool allowDiscoverable = false ) : System
sendReceiveOptions SendReceiveOptions The SendReceiveOptions to use with incoming data on this listener
applicationLayerProtocol ApplicationLayerProtocolStatus If enabled NetworkComms.Net uses a custom /// application layer protocol to provide useful features such as inline serialisation, /// transparent packet transmission, remote peer handshake and information etc. We strongly /// recommend you enable the NetworkComms.Net application layer protocol.
udpOptions UDPOptions The UDPOptions to use with this listener
allowDiscoverable bool Determines if the newly created will be discoverable if is enabled.
return System
        public UDPConnectionListener(SendReceiveOptions sendReceiveOptions,
            ApplicationLayerProtocolStatus applicationLayerProtocol, 
            UDPOptions udpOptions, bool allowDiscoverable = false)
            :base(ConnectionType.UDP, sendReceiveOptions, applicationLayerProtocol, allowDiscoverable)
        {
            if (applicationLayerProtocol == ApplicationLayerProtocolStatus.Disabled && udpOptions != UDPOptions.None)
                throw new ArgumentException("If the application layer protocol has been disabled the provided UDPOptions can only be UDPOptions.None.");

            UDPOptions = udpOptions;
        }