LocalPort Property

log4net SDK Reference |

# UdpAppender.LocalPort Property

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

[Visual Basic]
Public Property LocalPort As Integer
[C#]
public int LocalPort {get; set;}

#### Property Value

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

#### 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.

#### Exceptions

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

#### See Also

UdpAppender Class | log4net.Appender Namespace