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()

 

init()

 

Sub New()

constructor (AddressFamily)    (declared in Binding)

 

constructor(addressFamily: AddressFamily)

 

ServerBinding(AddressFamily addressFamily)

 

init(_ addressFamily: AddressFamily)

 

Sub New(addressFamily As AddressFamily)

Parameters:

  • addressFamily:

Accept

Returns a Connection instance with attached listening socket.

 

method Accept: Connection

 

Connection Accept()

 

func Accept() -> Connection

 

Function Accept() As Connection

Address    (declared in Binding)

The IP Address of the binding.

 

property Address: IPAddress read write;

 

IPAddress Address { get; set; }

 

var Address: IPAddress { 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; }

 

var 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)

 

func Bind(_ listener: IListener)

 

Sub Bind(listener As IListener)

Parameters:

  • listener: Custom socket listener

BindUnthreaded

Associates a listening Socket with a local endpoint.

 

method BindUnthreaded

 

void BindUnthreaded()

 

func BindUnthreaded()

 

Sub BindUnthreaded()

DefaultPort    (declared in Binding)

 

property DefaultPort: Int32 read write;

 

Int32 DefaultPort { get; set; }

 

var DefaultPort: Int32 { 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.

 

[DefaultValue(false)]
property EnableNagle: Boolean read write;

 

[DefaultValue(false)]
Boolean EnableNagle { get; set; }

 

@DefaultValue(false)
var EnableNagle: Boolean { get{} set{} }

 

<DefaultValue(false)>
Property EnableNagle() As Boolean

EndPoint

 

property EndPoint: IPEndPoint read;

 

IPEndPoint EndPoint { get; }

 

var EndPoint: IPEndPoint { 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.

 

[DefaultValue(1)]
property ListenerThreadCount: Int32 read write;

 

[DefaultValue(1)]
Int32 ListenerThreadCount { get; set; }

 

@DefaultValue(1)
var ListenerThreadCount: Int32 { get{} set{} }

 

<DefaultValue(1)>
Property ListenerThreadCount() As Int32

ListeningSocket

 

property ListeningSocket: Socket read;

 

Socket ListeningSocket { get; }

 

var ListeningSocket: Socket { get{} }

 

ReadOnly Property ListeningSocket() As Socket

MaxWaitConnections

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

The default value is 100

 

[DefaultValue(50)]
property MaxWaitConnections: Int32 read write;

 

[DefaultValue(50)]
Int32 MaxWaitConnections { get; set; }

 

@DefaultValue(50)
var MaxWaitConnections: Int32 { get{} set{} }

 

<DefaultValue(50)>
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; }

 

var Port: Int32 { 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; }

 

var Protocol: ProtocolType { 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; }

 

var ReuseAddress: Boolean { get{} set{} }

 

Property ReuseAddress() As Boolean

ShouldSerializePort    (declared in Binding)

 

method ShouldSerializePort: Boolean

 

Boolean ShouldSerializePort()

 

func ShouldSerializePort() -> Boolean

 

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; }

 

var SocketType: SocketType { get{} set{} }

 

Property SocketType() As SocketType

Unbind

Unbinds the listening socket.

 

method Unbind

 

void Unbind()

 

func 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)

 

func Unbind(_ block: Boolean)

 

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; }

 

var Address: IPAddress { 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; }

 

var AddressFamily: AddressFamily { get{} set{} }

 

Property AddressFamily() As AddressFamily

DefaultPort    (declared in Binding)

 

property DefaultPort: Int32 read write;

 

Int32 DefaultPort { get; set; }

 

var DefaultPort: Int32 { 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.

 

[DefaultValue(false)]
property EnableNagle: Boolean read write;

 

[DefaultValue(false)]
Boolean EnableNagle { get; set; }

 

@DefaultValue(false)
var EnableNagle: Boolean { get{} set{} }

 

<DefaultValue(false)>
Property EnableNagle() As Boolean

EndPoint

 

property EndPoint: IPEndPoint read;

 

IPEndPoint EndPoint { get; }

 

var EndPoint: IPEndPoint { 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.

 

[DefaultValue(1)]
property ListenerThreadCount: Int32 read write;

 

[DefaultValue(1)]
Int32 ListenerThreadCount { get; set; }

 

@DefaultValue(1)
var ListenerThreadCount: Int32 { get{} set{} }

 

<DefaultValue(1)>
Property ListenerThreadCount() As Int32

ListeningSocket

 

property ListeningSocket: Socket read;

 

Socket ListeningSocket { get; }

 

var ListeningSocket: Socket { get{} }

 

ReadOnly Property ListeningSocket() As Socket

MaxWaitConnections

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

The default value is 100

 

[DefaultValue(50)]
property MaxWaitConnections: Int32 read write;

 

[DefaultValue(50)]
Int32 MaxWaitConnections { get; set; }

 

@DefaultValue(50)
var MaxWaitConnections: Int32 { get{} set{} }

 

<DefaultValue(50)>
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; }

 

var Port: Int32 { 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; }

 

var Protocol: ProtocolType { 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; }

 

var ReuseAddress: Boolean { 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; }

 

var SocketType: SocketType { get{} set{} }

 

Property SocketType() As SocketType

 

constructor

Creates a new instance of the ServerBinding class.

 

constructor

 

ServerBinding()

 

init()

 

Sub New()

constructor (AddressFamily)    (declared in Binding)

 

constructor(addressFamily: AddressFamily)

 

ServerBinding(AddressFamily addressFamily)

 

init(_ addressFamily: AddressFamily)

 

Sub New(addressFamily As AddressFamily)

Parameters:

  • addressFamily:

Accept

Returns a Connection instance with attached listening socket.

 

method Accept: Connection

 

Connection Accept()

 

func Accept() -> Connection

 

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)

 

func Bind(_ listener: IListener)

 

Sub Bind(listener As IListener)

Parameters:

  • listener: Custom socket listener

BindUnthreaded

Associates a listening Socket with a local endpoint.

 

method BindUnthreaded

 

void BindUnthreaded()

 

func BindUnthreaded()

 

Sub BindUnthreaded()

ShouldSerializePort    (declared in Binding)

 

method ShouldSerializePort: Boolean

 

Boolean ShouldSerializePort()

 

func ShouldSerializePort() -> Boolean

 

Function ShouldSerializePort() As Boolean

Unbind

Unbinds the listening socket.

 

method Unbind

 

void Unbind()

 

func 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)

 

func Unbind(_ block: Boolean)

 

Sub Unbind(block As Boolean)

Parameters:

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