CommandBasedServer

Overview

An abstract base server. You will usually deal with FtpServer that descend from this class.

Location


 

constructor  protected

 

constructor

 

CommandBasedServer()

 

init()

 

Sub New()

Active  virtual    (declared in Server)

Gets or sets the flag defining whether the server is listening for incoming connections.

Setting this property to true or false calls the Open or Close methods, accordingly

 

property Active: Boolean read write;

 

Boolean Active { get; set; }

 

var Active: Boolean { get{} set{} }

 

Property Active() As Boolean

AddCustomCommand  virtual

Add custom command to the server collection.

 

method AddCustomCommand(name: String; handler: OnCommandHandler)

 

void AddCustomCommand(String name, OnCommandHandler handler)

 

func AddCustomCommand(_ name: String, _ handler: OnCommandHandler)

 

Sub AddCustomCommand(name As String, handler As OnCommandHandler)

Parameters:

  • name:
  • handler:

BindAddressV4  virtual    (declared in Server)

 

property BindAddressV4: IPAddress read write;

 

IPAddress BindAddressV4 { get; set; }

 

var BindAddressV4: IPAddress { get{} set{} }

 

Property BindAddressV4() As IPAddress

BindAddressV6  virtual    (declared in Server)

 

property BindAddressV6: IPAddress read write;

 

IPAddress BindAddressV6 { get; set; }

 

var BindAddressV6: IPAddress { get{} set{} }

 

Property BindAddressV6() As IPAddress

Binding  virtual    (declared in Server)

Gets the ServerBinding instance.

In most cases, the IPv4 ServerBinding instance is returned. If the IPv4 protocol is not bound due to platform restictions, the IPv6 binding is returned.

 

property Binding: ServerBinding read;

 

ServerBinding Binding { get; }

 

var Binding: ServerBinding { get{} }

 

ReadOnly Property Binding() As ServerBinding

BindingV4  virtual    (declared in Server)

Gets the IPv4 ServerBinding instance.

The returned instance can be used to fine-tune the IPv4 server endpoint.

 

property BindingV4: ServerBinding read;

 

ServerBinding BindingV4 { get; }

 

var BindingV4: ServerBinding { get{} }

 

ReadOnly Property BindingV4() As ServerBinding

BindingV6  virtual    (declared in Server)

Gets the IPv6 ServerBinding instance.

The returned instance can be used to fine-tune the IPv6 server endpoint.

 

property BindingV6: ServerBinding read;

 

ServerBinding BindingV6 { get; }

 

var BindingV6: ServerBinding { get{} }

 

ReadOnly Property BindingV6() As ServerBinding

BindV4  virtual    (declared in Server)

Gets or sets the flag indicating whether the server should listen for IPv4 connections.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true or by directly calling the Open method).

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property BindV4: Boolean read write;
// Island
property BindV4: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean BindV4 { get; set; }
// Island
Boolean BindV4 { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var BindV4: Boolean { get{} set{} }
// Island, Toffee
var BindV4: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property BindV4() As Boolean
// Island
Property BindV4() As Boolean

BindV6  virtual    (declared in Server)

Gets or sets the flag indicating whether the server should listen for IPv6 connections.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true or by directly calling the Open method).

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property BindV6: Boolean read write;
// Island
property BindV6: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean BindV6 { get; set; }
// Island
Boolean BindV6 { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var BindV6: Boolean { get{} set{} }
// Island, Toffee
var BindV6: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property BindV6() As Boolean
// Island
Property BindV6() As Boolean

CleanStringForCommandResponse  protected virtual

 

class method CleanStringForCommandResponse(rawValue: String): String

 

static String CleanStringForCommandResponse(String rawValue)

 

static func CleanStringForCommandResponse(_ rawValue: String) -> String

 

Shared Function CleanStringForCommandResponse(rawValue As String) As String

Parameters:

  • rawValue:

Close  virtual    (declared in Server)

This method causes the server to stop listening for incoming connections.

 

method Close

 

void Close()

 

func Close()

 

Sub Close()

CloseConnectionsOnShutdown  virtual    (declared in Server)

Gets or sets the flag indicating whether the currently open client connections should be appropriately closed on server shutdown.

The default value is true.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property CloseConnectionsOnShutdown: Boolean read write;
// Island
property CloseConnectionsOnShutdown: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean CloseConnectionsOnShutdown { get; set; }
// Island
Boolean CloseConnectionsOnShutdown { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var CloseConnectionsOnShutdown: Boolean { get{} set{} }
// Island, Toffee
var CloseConnectionsOnShutdown: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property CloseConnectionsOnShutdown() As Boolean
// Island
Property CloseConnectionsOnShutdown() As Boolean

Commands  virtual

 

property Commands: Dictionary<String, OnCommandHandler> read;

 

Dictionary<String, OnCommandHandler> Commands { get; }

 

var Commands: Dictionary<String, OnCommandHandler> { get{} }

 

ReadOnly Property Commands() As Dictionary<String, OnCommandHandler>

ConnectionClass    (declared in Server) .NET, .NET Core 5.0, .NET Standard 2.0

Gets or sets an alternative Connection class to be used for incoming data connections. The class described by the assigned Type must be a descendant of the Connection class, and will be used for all connections that are established after the property has been set.

Existing connections are not affected by changing the property.

If the ConnectionType property value is null (default), instances of the Connection base class will be used.

 

[DefaultValue(nil)]
property ConnectionClass: Type read write;

 

[DefaultValue(null)]
Type ConnectionClass { get; set; }

 

@DefaultValue(nil)
var ConnectionClass: Type { get{} set{} }

 

<DefaultValue(Null)>
Property ConnectionClass() As Type

ConnectionFactory  virtual    (declared in Server)

Gets or sets an alternative Connection factory instance to be used for incoming data connections. This factory will be used to create corresponding Connection instances for all connections that are established after the property has been set.

Existing connections are not affected by changing the property.

This property has precendence over the ConnectionClass property.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(nil)]
property ConnectionFactory: IConnectionFactory read write;
// Island
property ConnectionFactory: IConnectionFactory read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(null)]
IConnectionFactory ConnectionFactory { get; set; }
// Island
IConnectionFactory ConnectionFactory { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(nil)
var ConnectionFactory: IConnectionFactory { get{} set{} }
// Island, Toffee
var ConnectionFactory: IConnectionFactory { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(Null)>
Property ConnectionFactory() As IConnectionFactory
// Island
Property ConnectionFactory() As IConnectionFactory

CreateSession  protected virtual

 

method CreateSession: CommandBasedSession

 

CommandBasedSession CreateSession()

 

func CreateSession() -> CommandBasedSession

 

Function CreateSession() As CommandBasedSession

DefaultPort  protected virtual    (declared in Server)

Gets or sets the default port number.

 

property DefaultPort: Int32 read write;

 

Int32 DefaultPort { get; set; }

 

var DefaultPort: Int32 { get{} set{} }

 

Property DefaultPort() As Int32

Dispose  protected override    (declared in Server)

Disposes of the current instance and releases all resources used by it.

 

method Dispose(disposing: Boolean)

 

void Dispose(Boolean disposing)

 

func Dispose(_ disposing: Boolean)

 

Sub Dispose(disposing As Boolean)

Parameters:

  • disposing:

EnableNagle  virtual    (declared in Server)

Gets or the sets flag indicating whether the Nagle's algoritm should be used.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true or by directly calling the Open method).

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(false)]
property EnableNagle: Boolean read write;
// Island
property EnableNagle: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(false)]
Boolean EnableNagle { get; set; }
// Island
Boolean EnableNagle { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(false)
var EnableNagle: Boolean { get{} set{} }
// Island, Toffee
var EnableNagle: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(false)>
Property EnableNagle() As Boolean
// Island
Property EnableNagle() As Boolean

GetDefaultSessionClass  protected virtual

 

method GetDefaultSessionClass: Type

 

Type GetDefaultSessionClass()

 

func GetDefaultSessionClass() -> Type

 

Function GetDefaultSessionClass() As Type

GetWorkerClass  override

 

method GetWorkerClass: Type

 

Type GetWorkerClass()

 

func GetWorkerClass() -> Type

 

Function GetWorkerClass() As Type

Greeting  virtual

 

property Greeting: String read write;

 

String Greeting { get; set; }

 

var Greeting: String { get{} set{} }

 

Property Greeting() As String

HandleCommandException  protected virtual

 

method HandleCommandException(connection: Connection; ex: Exception)

 

void HandleCommandException(Connection connection, Exception ex)

 

func HandleCommandException(_ connection: Connection, _ ex: Exception)

 

Sub HandleCommandException(connection As Connection, ex As Exception)

Parameters:

  • connection:
  • ex:

InitCommands  protected virtual abstract

 

method InitCommands

 

void InitCommands()

 

func InitCommands()

 

Sub InitCommands()

InvokeOnClientConnected  protected virtual

 

method InvokeOnClientConnected(e: SessionEventArgs)

 

void InvokeOnClientConnected(SessionEventArgs e)

 

func InvokeOnClientConnected(_ e: SessionEventArgs)

 

Sub InvokeOnClientConnected(e As SessionEventArgs)

Parameters:

  • e:

InvokeOnClientDisconnected  protected virtual

 

method InvokeOnClientDisconnected(e: SessionEventArgs)

 

void InvokeOnClientDisconnected(SessionEventArgs e)

 

func InvokeOnClientDisconnected(_ e: SessionEventArgs)

 

Sub InvokeOnClientDisconnected(e As SessionEventArgs)

Parameters:

  • e:

MaxLineLength  virtual    (declared in Server)

Gets or sets the default MaxLineLength value for all newly created Connections.

See the desription of the Connection.MaxLineLength property for details.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(4096)]
property MaxLineLength: Int32 read write;
// Island
property MaxLineLength: Int32 read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(4096)]
Int32 MaxLineLength { get; set; }
// Island
Int32 MaxLineLength { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(4096)
var MaxLineLength: Int32 { get{} set{} }
// Island, Toffee
var MaxLineLength: Int32 { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(4096)>
Property MaxLineLength() As Int32
// Island
Property MaxLineLength() As Int32

MaxLineLengthEnabled  virtual    (declared in Server)

Gets or sets the default MaxLineLengthEnabled value for all newly created Connections.

See the desription of the Connection.MaxLineLengthEnabled property for details.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property MaxLineLengthEnabled: Boolean read write;
// Island
property MaxLineLengthEnabled: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean MaxLineLengthEnabled { get; set; }
// Island
Boolean MaxLineLengthEnabled { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var MaxLineLengthEnabled: Boolean { get{} set{} }
// Island, Toffee
var MaxLineLengthEnabled: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property MaxLineLengthEnabled() As Boolean
// Island
Property MaxLineLengthEnabled() As Boolean

OnClientConnected

This event is fired when client connects to the server.

 

event OnClientConnected: OnClientConnectedHandler
delegate: method OnClientConnected(sender: Object; e: SessionEventArgs)

 

delegate OnClientConnectedHandler OnClientConnected()
delegate: void OnClientConnected(Object sender, SessionEventArgs e)

 

__event OnClientConnectedHandler: OnClientConnected!
delegate: func OnClientConnected(_ sender: Object, _ e: SessionEventArgs)

 

Event OnClientConnected As OnClientConnectedHandler
delegate: Sub OnClientConnected(sender As Object, e As SessionEventArgs)

OnClientDisconnected

This event is fired when client disconnects from the server.

 

event OnClientDisconnected: OnClientDisconnectedHandler
delegate: method OnClientDisconnected(sender: Object; e: SessionEventArgs)

 

delegate OnClientDisconnectedHandler OnClientDisconnected()
delegate: void OnClientDisconnected(Object sender, SessionEventArgs e)

 

__event OnClientDisconnectedHandler: OnClientDisconnected!
delegate: func OnClientDisconnected(_ sender: Object, _ e: SessionEventArgs)

 

Event OnClientDisconnected As OnClientDisconnectedHandler
delegate: Sub OnClientDisconnected(sender As Object, e As SessionEventArgs)

Open  virtual    (declared in Server)

This method causes the server to start listening for incoming connections.

 

method Open

 

void Open()

 

func Open()

 

Sub Open()

Port  virtual    (declared in Server)

Gets or sets the port number on which the server will listen.

 

property Port: Int32 read write;

 

Int32 Port { get; set; }

 

var Port: Int32 { get{} set{} }

 

Property Port() As Int32

SessionClass  virtual

Represents the session object.

 

property SessionClass: Type read write;

 

Type SessionClass { get; set; }

 

var SessionClass: Type { get{} set{} }

 

Property SessionClass() As Type

ShouldSerializePort  virtual    (declared in Server)

Returns true when the DefaultPort is not equal to the Port.

 

method ShouldSerializePort: Boolean

 

Boolean ShouldSerializePort()

 

func ShouldSerializePort() -> Boolean

 

Function ShouldSerializePort() As Boolean

Timeout  virtual    (declared in Server)

Gets or sets the default Timeout value for all newly created Connections.

See the desription of the Connection.Timeout property for details.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(300)]
property Timeout: Int32 read write;
// Island
property Timeout: Int32 read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(300)]
Int32 Timeout { get; set; }
// Island
Int32 Timeout { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(300)
var Timeout: Int32 { get{} set{} }
// Island, Toffee
var Timeout: Int32 { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(300)>
Property Timeout() As Int32
// Island
Property Timeout() As Int32

TimeoutEnabled  virtual    (declared in Server)

Gets or sets the default TimeoutEnabled value for all newly created Connections.

See the desription of the Connection.TimeoutEnabled property for details.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property TimeoutEnabled: Boolean read write;
// Island
property TimeoutEnabled: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean TimeoutEnabled { get; set; }
// Island
Boolean TimeoutEnabled { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var TimeoutEnabled: Boolean { get{} set{} }
// Island, Toffee
var TimeoutEnabled: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property TimeoutEnabled() As Boolean
// Island
Property TimeoutEnabled() As Boolean

UnknownCommand  virtual

If server receives unknown command then this property will be used as error message to show user.

 

property UnknownCommand: String read write;

 

String UnknownCommand { get; set; }

 

var UnknownCommand: String { get{} set{} }

 

Property UnknownCommand() As String

 

Active  virtual    (declared in Server)

Gets or sets the flag defining whether the server is listening for incoming connections.

Setting this property to true or false calls the Open or Close methods, accordingly

 

property Active: Boolean read write;

 

Boolean Active { get; set; }

 

var Active: Boolean { get{} set{} }

 

Property Active() As Boolean

BindAddressV4  virtual    (declared in Server)

 

property BindAddressV4: IPAddress read write;

 

IPAddress BindAddressV4 { get; set; }

 

var BindAddressV4: IPAddress { get{} set{} }

 

Property BindAddressV4() As IPAddress

BindAddressV6  virtual    (declared in Server)

 

property BindAddressV6: IPAddress read write;

 

IPAddress BindAddressV6 { get; set; }

 

var BindAddressV6: IPAddress { get{} set{} }

 

Property BindAddressV6() As IPAddress

Binding  virtual    (declared in Server)

Gets the ServerBinding instance.

In most cases, the IPv4 ServerBinding instance is returned. If the IPv4 protocol is not bound due to platform restictions, the IPv6 binding is returned.

 

property Binding: ServerBinding read;

 

ServerBinding Binding { get; }

 

var Binding: ServerBinding { get{} }

 

ReadOnly Property Binding() As ServerBinding

BindingV4  virtual    (declared in Server)

Gets the IPv4 ServerBinding instance.

The returned instance can be used to fine-tune the IPv4 server endpoint.

 

property BindingV4: ServerBinding read;

 

ServerBinding BindingV4 { get; }

 

var BindingV4: ServerBinding { get{} }

 

ReadOnly Property BindingV4() As ServerBinding

BindingV6  virtual    (declared in Server)

Gets the IPv6 ServerBinding instance.

The returned instance can be used to fine-tune the IPv6 server endpoint.

 

property BindingV6: ServerBinding read;

 

ServerBinding BindingV6 { get; }

 

var BindingV6: ServerBinding { get{} }

 

ReadOnly Property BindingV6() As ServerBinding

BindV4  virtual    (declared in Server)

Gets or sets the flag indicating whether the server should listen for IPv4 connections.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true or by directly calling the Open method).

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property BindV4: Boolean read write;
// Island
property BindV4: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean BindV4 { get; set; }
// Island
Boolean BindV4 { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var BindV4: Boolean { get{} set{} }
// Island, Toffee
var BindV4: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property BindV4() As Boolean
// Island
Property BindV4() As Boolean

BindV6  virtual    (declared in Server)

Gets or sets the flag indicating whether the server should listen for IPv6 connections.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true or by directly calling the Open method).

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property BindV6: Boolean read write;
// Island
property BindV6: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean BindV6 { get; set; }
// Island
Boolean BindV6 { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var BindV6: Boolean { get{} set{} }
// Island, Toffee
var BindV6: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property BindV6() As Boolean
// Island
Property BindV6() As Boolean

CloseConnectionsOnShutdown  virtual    (declared in Server)

Gets or sets the flag indicating whether the currently open client connections should be appropriately closed on server shutdown.

The default value is true.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property CloseConnectionsOnShutdown: Boolean read write;
// Island
property CloseConnectionsOnShutdown: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean CloseConnectionsOnShutdown { get; set; }
// Island
Boolean CloseConnectionsOnShutdown { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var CloseConnectionsOnShutdown: Boolean { get{} set{} }
// Island, Toffee
var CloseConnectionsOnShutdown: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property CloseConnectionsOnShutdown() As Boolean
// Island
Property CloseConnectionsOnShutdown() As Boolean

Commands  virtual

 

property Commands: Dictionary<String, OnCommandHandler> read;

 

Dictionary<String, OnCommandHandler> Commands { get; }

 

var Commands: Dictionary<String, OnCommandHandler> { get{} }

 

ReadOnly Property Commands() As Dictionary<String, OnCommandHandler>

ConnectionClass    (declared in Server) .NET, .NET Core 5.0, .NET Standard 2.0

Gets or sets an alternative Connection class to be used for incoming data connections. The class described by the assigned Type must be a descendant of the Connection class, and will be used for all connections that are established after the property has been set.

Existing connections are not affected by changing the property.

If the ConnectionType property value is null (default), instances of the Connection base class will be used.

 

[DefaultValue(nil)]
property ConnectionClass: Type read write;

 

[DefaultValue(null)]
Type ConnectionClass { get; set; }

 

@DefaultValue(nil)
var ConnectionClass: Type { get{} set{} }

 

<DefaultValue(Null)>
Property ConnectionClass() As Type

ConnectionFactory  virtual    (declared in Server)

Gets or sets an alternative Connection factory instance to be used for incoming data connections. This factory will be used to create corresponding Connection instances for all connections that are established after the property has been set.

Existing connections are not affected by changing the property.

This property has precendence over the ConnectionClass property.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(nil)]
property ConnectionFactory: IConnectionFactory read write;
// Island
property ConnectionFactory: IConnectionFactory read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(null)]
IConnectionFactory ConnectionFactory { get; set; }
// Island
IConnectionFactory ConnectionFactory { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(nil)
var ConnectionFactory: IConnectionFactory { get{} set{} }
// Island, Toffee
var ConnectionFactory: IConnectionFactory { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(Null)>
Property ConnectionFactory() As IConnectionFactory
// Island
Property ConnectionFactory() As IConnectionFactory

DefaultPort  protected virtual    (declared in Server)

Gets or sets the default port number.

 

property DefaultPort: Int32 read write;

 

Int32 DefaultPort { get; set; }

 

var DefaultPort: Int32 { get{} set{} }

 

Property DefaultPort() As Int32

EnableNagle  virtual    (declared in Server)

Gets or the sets flag indicating whether the Nagle's algoritm should be used.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true or by directly calling the Open method).

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(false)]
property EnableNagle: Boolean read write;
// Island
property EnableNagle: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(false)]
Boolean EnableNagle { get; set; }
// Island
Boolean EnableNagle { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(false)
var EnableNagle: Boolean { get{} set{} }
// Island, Toffee
var EnableNagle: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(false)>
Property EnableNagle() As Boolean
// Island
Property EnableNagle() As Boolean

Greeting  virtual

 

property Greeting: String read write;

 

String Greeting { get; set; }

 

var Greeting: String { get{} set{} }

 

Property Greeting() As String

MaxLineLength  virtual    (declared in Server)

Gets or sets the default MaxLineLength value for all newly created Connections.

See the desription of the Connection.MaxLineLength property for details.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(4096)]
property MaxLineLength: Int32 read write;
// Island
property MaxLineLength: Int32 read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(4096)]
Int32 MaxLineLength { get; set; }
// Island
Int32 MaxLineLength { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(4096)
var MaxLineLength: Int32 { get{} set{} }
// Island, Toffee
var MaxLineLength: Int32 { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(4096)>
Property MaxLineLength() As Int32
// Island
Property MaxLineLength() As Int32

MaxLineLengthEnabled  virtual    (declared in Server)

Gets or sets the default MaxLineLengthEnabled value for all newly created Connections.

See the desription of the Connection.MaxLineLengthEnabled property for details.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property MaxLineLengthEnabled: Boolean read write;
// Island
property MaxLineLengthEnabled: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean MaxLineLengthEnabled { get; set; }
// Island
Boolean MaxLineLengthEnabled { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var MaxLineLengthEnabled: Boolean { get{} set{} }
// Island, Toffee
var MaxLineLengthEnabled: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property MaxLineLengthEnabled() As Boolean
// Island
Property MaxLineLengthEnabled() As Boolean

Port  virtual    (declared in Server)

Gets or sets the port number on which the server will listen.

 

property Port: Int32 read write;

 

Int32 Port { get; set; }

 

var Port: Int32 { get{} set{} }

 

Property Port() As Int32

SessionClass  virtual

Represents the session object.

 

property SessionClass: Type read write;

 

Type SessionClass { get; set; }

 

var SessionClass: Type { get{} set{} }

 

Property SessionClass() As Type

Timeout  virtual    (declared in Server)

Gets or sets the default Timeout value for all newly created Connections.

See the desription of the Connection.Timeout property for details.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(300)]
property Timeout: Int32 read write;
// Island
property Timeout: Int32 read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(300)]
Int32 Timeout { get; set; }
// Island
Int32 Timeout { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(300)
var Timeout: Int32 { get{} set{} }
// Island, Toffee
var Timeout: Int32 { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(300)>
Property Timeout() As Int32
// Island
Property Timeout() As Int32

TimeoutEnabled  virtual    (declared in Server)

Gets or sets the default TimeoutEnabled value for all newly created Connections.

See the desription of the Connection.TimeoutEnabled property for details.

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
property TimeoutEnabled: Boolean read write;
// Island
property TimeoutEnabled: Boolean read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(true)]
Boolean TimeoutEnabled { get; set; }
// Island
Boolean TimeoutEnabled { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(true)
var TimeoutEnabled: Boolean { get{} set{} }
// Island, Toffee
var TimeoutEnabled: Boolean { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(true)>
Property TimeoutEnabled() As Boolean
// Island
Property TimeoutEnabled() As Boolean

UnknownCommand  virtual

If server receives unknown command then this property will be used as error message to show user.

 

property UnknownCommand: String read write;

 

String UnknownCommand { get; set; }

 

var UnknownCommand: String { get{} set{} }

 

Property UnknownCommand() As String

 

CleanStringForCommandResponse  protected virtual

 

class method CleanStringForCommandResponse(rawValue: String): String

 

static String CleanStringForCommandResponse(String rawValue)

 

static func CleanStringForCommandResponse(_ rawValue: String) -> String

 

Shared Function CleanStringForCommandResponse(rawValue As String) As String

Parameters:

  • rawValue:

 

constructor  protected

 

constructor

 

CommandBasedServer()

 

init()

 

Sub New()

AddCustomCommand  virtual

Add custom command to the server collection.

 

method AddCustomCommand(name: String; handler: OnCommandHandler)

 

void AddCustomCommand(String name, OnCommandHandler handler)

 

func AddCustomCommand(_ name: String, _ handler: OnCommandHandler)

 

Sub AddCustomCommand(name As String, handler As OnCommandHandler)

Parameters:

  • name:
  • handler:

Close  virtual    (declared in Server)

This method causes the server to stop listening for incoming connections.

 

method Close

 

void Close()

 

func Close()

 

Sub Close()

CreateSession  protected virtual

 

method CreateSession: CommandBasedSession

 

CommandBasedSession CreateSession()

 

func CreateSession() -> CommandBasedSession

 

Function CreateSession() As CommandBasedSession

Dispose  protected override    (declared in Server)

Disposes of the current instance and releases all resources used by it.

 

method Dispose(disposing: Boolean)

 

void Dispose(Boolean disposing)

 

func Dispose(_ disposing: Boolean)

 

Sub Dispose(disposing As Boolean)

Parameters:

  • disposing:

GetDefaultSessionClass  protected virtual

 

method GetDefaultSessionClass: Type

 

Type GetDefaultSessionClass()

 

func GetDefaultSessionClass() -> Type

 

Function GetDefaultSessionClass() As Type

GetWorkerClass  override

 

method GetWorkerClass: Type

 

Type GetWorkerClass()

 

func GetWorkerClass() -> Type

 

Function GetWorkerClass() As Type

HandleCommandException  protected virtual

 

method HandleCommandException(connection: Connection; ex: Exception)

 

void HandleCommandException(Connection connection, Exception ex)

 

func HandleCommandException(_ connection: Connection, _ ex: Exception)

 

Sub HandleCommandException(connection As Connection, ex As Exception)

Parameters:

  • connection:
  • ex:

InitCommands  protected virtual abstract

 

method InitCommands

 

void InitCommands()

 

func InitCommands()

 

Sub InitCommands()

InvokeOnClientConnected  protected virtual

 

method InvokeOnClientConnected(e: SessionEventArgs)

 

void InvokeOnClientConnected(SessionEventArgs e)

 

func InvokeOnClientConnected(_ e: SessionEventArgs)

 

Sub InvokeOnClientConnected(e As SessionEventArgs)

Parameters:

  • e:

InvokeOnClientDisconnected  protected virtual

 

method InvokeOnClientDisconnected(e: SessionEventArgs)

 

void InvokeOnClientDisconnected(SessionEventArgs e)

 

func InvokeOnClientDisconnected(_ e: SessionEventArgs)

 

Sub InvokeOnClientDisconnected(e As SessionEventArgs)

Parameters:

  • e:

Open  virtual    (declared in Server)

This method causes the server to start listening for incoming connections.

 

method Open

 

void Open()

 

func Open()

 

Sub Open()

ShouldSerializePort  virtual    (declared in Server)

Returns true when the DefaultPort is not equal to the Port.

 

method ShouldSerializePort: Boolean

 

Boolean ShouldSerializePort()

 

func ShouldSerializePort() -> Boolean

 

Function ShouldSerializePort() As Boolean

 

OnClientConnected

This event is fired when client connects to the server.

 

event OnClientConnected: OnClientConnectedHandler
delegate: method OnClientConnected(sender: Object; e: SessionEventArgs)

 

delegate OnClientConnectedHandler OnClientConnected()
delegate: void OnClientConnected(Object sender, SessionEventArgs e)

 

__event OnClientConnectedHandler: OnClientConnected!
delegate: func OnClientConnected(_ sender: Object, _ e: SessionEventArgs)

 

Event OnClientConnected As OnClientConnectedHandler
delegate: Sub OnClientConnected(sender As Object, e As SessionEventArgs)

OnClientDisconnected

This event is fired when client disconnects from the server.

 

event OnClientDisconnected: OnClientDisconnectedHandler
delegate: method OnClientDisconnected(sender: Object; e: SessionEventArgs)

 

delegate OnClientDisconnectedHandler OnClientDisconnected()
delegate: void OnClientDisconnected(Object sender, SessionEventArgs e)

 

__event OnClientDisconnectedHandler: OnClientDisconnected!
delegate: func OnClientDisconnected(_ sender: Object, _ e: SessionEventArgs)

 

Event OnClientDisconnected As OnClientDisconnectedHandler
delegate: Sub OnClientDisconnected(sender As Object, e As SessionEventArgs)