UdpAppender LocalPort Property | Apache log4net™ SDK Documentation

Gets or sets the TCP port number from which the underlying UdpClient will communicate.

Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public int LocalPort { get; set; }

    Public Property LocalPort As Integer
    	Get
    	Set

    public:
    property int LocalPort {
    	int get ();
    	void set (int value);
    }

    member LocalPort : int with get, set

#### Property Value

Type: Int32
An integer value in the range MinPort to MaxPort indicating the TCP port number from which the underlying UdpClient will communicate.
Exceptions

Exception | Condition
--- | ---
ArgumentOutOfRangeException | The value specified is less than MinPort or greater than MaxPort.

Remarks

The underlying UdpClient will bind to this port for sending messages.

Setting the value to 0 (the default) will cause the udp client not to bind to a local port.

See Also

#### Reference

UdpAppender Class
log4net.Appender Namespace