ServerBinding

Overview

The ServerBinding class represents an EndPoint that a server applocation will be accepting connections on.

The binding can be bound to activate it and start listening for incoming connections, or unbound to close it.

Location

 

constructor

Creates a new instance of the ServerBinding class.

 

constructor

 

ServerBinding()

 

Sub New()

constructor (AddressFamily)    (declared in Binding)

 

constructor(addressFamily: AddressFamily)

 

ServerBinding(AddressFamily addressFamily)

 

Sub New(addressFamily As AddressFamily)

Parameters:

  • addressFamily:

Accept

Returns a Connection instance with attached listening socket.

 

method Accept: Connection

 

Connection Accept()

 

Function Accept() As Connection

Address    (declared in Binding)

The IP Address of the binding.

 

property Address: IPAddress read write;

 

IPAddress Address { get; set; }

 

Property Address() As IPAddress

AddressFamily    (declared in Binding)

AddressFamily denotes the type of address (and thus the means to communicate) of the binding. The default value for "InterNetwork" is defined in System.Net.Sockets.AddressFamily

 

property AddressFamily: AddressFamily read write;

 

AddressFamily AddressFamily { get; set; }

 

Property AddressFamily() As AddressFamily

Bind

Associates a listening Socket with a local endpoint. Then this socket is passed to the provided IListener instance and a configured amount of listener thereads is started.

 

method Bind(listener: IListener)

 

void Bind(IListener listener)

 

Sub Bind(listener As IListener)

Parameters:

  • listener: Custom socket listener

BindUnthreaded

Associates a listening Socket with a local endpoint.

 

method BindUnthreaded

 

void BindUnthreaded()

 

Sub BindUnthreaded()

DefaultPort    (declared in Binding)

 

property DefaultPort: Int32 read write;

 

Int32 DefaultPort { get; set; }

 

Property DefaultPort() As Int32

EnableNagle

Gets or sets a flag indicating whether a Nagle algorithm should be used while binding a socket.

The default value is false

Note: This property won't affect the socket settings is it is set after the socket is bound.

 

property EnableNagle: Boolean read write;

 

Boolean EnableNagle { get; set; }

 

Property EnableNagle() As Boolean

EndPoint

 

property EndPoint: IPEndPoint read;

 

IPEndPoint EndPoint { get; }

 

ReadOnly Property EndPoint() As IPEndPoint

ListenerThreadCount

Gets or sets the number of listener threads.

The default value is 1

Note: This property won't affect the socket settings is it is set after the socket is bound.

 

property ListenerThreadCount: Int32 read write;

 

Int32 ListenerThreadCount { get; set; }

 

Property ListenerThreadCount() As Int32

ListeningSocket

 

property ListeningSocket: Socket read;

 

Socket ListeningSocket { get; }

 

ReadOnly Property ListeningSocket() As Socket

MaxWaitConnections

Gets or sets the length of the internal Socket listener backlog.

The default value is 100

 

property MaxWaitConnections: Int32 read write;

 

Int32 MaxWaitConnections { get; set; }

 

Property MaxWaitConnections() As Int32

Port    (declared in Binding)

Denotes the port number associated with the socket binding. On a server connection, this would be the obvious protocol numbers (e.g: HTTP=80, FTP=21), on the client this number is assigned by the operating system when creating the socket.

 

property Port: Int32 read write;

 

Int32 Port { get; set; }

 

Property Port() As Int32

Protocol    (declared in Binding)

Denotes the transport level protocol to use to communicate over the socket. The default value "TCP" is defined in System.Net.Sockets.ProtocolType

 

property Protocol: ProtocolType read write;

 

ProtocolType Protocol { get; set; }

 

Property Protocol() As ProtocolType

ReuseAddress

Gets or sets a flag indicating whether the socket is allowed to be bound to an address that is already in use.

The default value is true

 

property ReuseAddress: Boolean read write;

 

Boolean ReuseAddress { get; set; }

 

Property ReuseAddress() As Boolean

ShouldSerializePort    (declared in Binding)

 

method ShouldSerializePort: Boolean

 

Boolean ShouldSerializePort()

 

Function ShouldSerializePort() As Boolean

SocketType    (declared in Binding)

Denotes the type of socket used to use to communicate. Defined in System.Net.Sockets.SocketType

 

property SocketType: SocketType read write;

 

SocketType SocketType { get; set; }

 

Property SocketType() As SocketType

Unbind

Unbinds the listening socket.

 

method Unbind

 

void Unbind()

 

Sub Unbind()

Unbind (Boolean)

Unbinds the listening socket.

Optionally waits until all listening threads are terminated.

 

method Unbind(block: Boolean)

 

void Unbind(Boolean block)

 

Sub Unbind(block As Boolean)

Parameters:

  • block: A flag indicating whether method should wait until all listening threads are terminated

 

Address    (declared in Binding)

The IP Address of the binding.

 

property Address: IPAddress read write;

 

IPAddress Address { get; set; }

 

Property Address() As IPAddress

AddressFamily    (declared in Binding)

AddressFamily denotes the type of address (and thus the means to communicate) of the binding. The default value for "InterNetwork" is defined in System.Net.Sockets.AddressFamily

 

property AddressFamily: AddressFamily read write;

 

AddressFamily AddressFamily { get; set; }

 

Property AddressFamily() As AddressFamily

DefaultPort    (declared in Binding)

 

property DefaultPort: Int32 read write;

 

Int32 DefaultPort { get; set; }

 

Property DefaultPort() As Int32

EnableNagle

Gets or sets a flag indicating whether a Nagle algorithm should be used while binding a socket.

The default value is false

Note: This property won't affect the socket settings is it is set after the socket is bound.

 

property EnableNagle: Boolean read write;

 

Boolean EnableNagle { get; set; }

 

Property EnableNagle() As Boolean

EndPoint

 

property EndPoint: IPEndPoint read;

 

IPEndPoint EndPoint { get; }

 

ReadOnly Property EndPoint() As IPEndPoint

ListenerThreadCount

Gets or sets the number of listener threads.

The default value is 1

Note: This property won't affect the socket settings is it is set after the socket is bound.

 

property ListenerThreadCount: Int32 read write;

 

Int32 ListenerThreadCount { get; set; }

 

Property ListenerThreadCount() As Int32

ListeningSocket

 

property ListeningSocket: Socket read;

 

Socket ListeningSocket { get; }

 

ReadOnly Property ListeningSocket() As Socket

MaxWaitConnections

Gets or sets the length of the internal Socket listener backlog.

The default value is 100

 

property MaxWaitConnections: Int32 read write;

 

Int32 MaxWaitConnections { get; set; }

 

Property MaxWaitConnections() As Int32

Port    (declared in Binding)

Denotes the port number associated with the socket binding. On a server connection, this would be the obvious protocol numbers (e.g: HTTP=80, FTP=21), on the client this number is assigned by the operating system when creating the socket.

 

property Port: Int32 read write;

 

Int32 Port { get; set; }

 

Property Port() As Int32

Protocol    (declared in Binding)

Denotes the transport level protocol to use to communicate over the socket. The default value "TCP" is defined in System.Net.Sockets.ProtocolType

 

property Protocol: ProtocolType read write;

 

ProtocolType Protocol { get; set; }

 

Property Protocol() As ProtocolType

ReuseAddress

Gets or sets a flag indicating whether the socket is allowed to be bound to an address that is already in use.

The default value is true

 

property ReuseAddress: Boolean read write;

 

Boolean ReuseAddress { get; set; }

 

Property ReuseAddress() As Boolean

SocketType    (declared in Binding)

Denotes the type of socket used to use to communicate. Defined in System.Net.Sockets.SocketType

 

property SocketType: SocketType read write;

 

SocketType SocketType { get; set; }

 

Property SocketType() As SocketType

 

constructor

Creates a new instance of the ServerBinding class.

 

constructor

 

ServerBinding()

 

Sub New()

constructor (AddressFamily)    (declared in Binding)

 

constructor(addressFamily: AddressFamily)

 

ServerBinding(AddressFamily addressFamily)

 

Sub New(addressFamily As AddressFamily)

Parameters:

  • addressFamily:

Accept

Returns a Connection instance with attached listening socket.

 

method Accept: Connection

 

Connection Accept()

 

Function Accept() As Connection

Bind

Associates a listening Socket with a local endpoint. Then this socket is passed to the provided IListener instance and a configured amount of listener thereads is started.

 

method Bind(listener: IListener)

 

void Bind(IListener listener)

 

Sub Bind(listener As IListener)

Parameters:

  • listener: Custom socket listener

BindUnthreaded

Associates a listening Socket with a local endpoint.

 

method BindUnthreaded

 

void BindUnthreaded()

 

Sub BindUnthreaded()

ShouldSerializePort    (declared in Binding)

 

method ShouldSerializePort: Boolean

 

Boolean ShouldSerializePort()

 

Function ShouldSerializePort() As Boolean

Unbind

Unbinds the listening socket.

 

method Unbind

 

void Unbind()

 

Sub Unbind()

Unbind (Boolean)

Unbinds the listening socket.

Optionally waits until all listening threads are terminated.

 

method Unbind(block: Boolean)

 

void Unbind(Boolean block)

 

Sub Unbind(block As Boolean)

Parameters:

  • block: A flag indicating whether method should wait until all listening threads are terminated