SimpleHttpServer

Overview

SimpleHttpServer is a simple file based HTTP Server that will make all files in and below the specified RootPath folder available via HTTP.

SimpleHttpServer is really more an example of how to implement custom HTTP Servers using Internet Pack then a component usable in real life. However, it might be expanded over time to provided more options and become a full-fledged HTTP Server.

Location

 

constructor .NET, .NET Core 5.0, .NET Standard 2.0, Island

 

constructor

 

SimpleHttpServer()

 

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

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

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

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

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

GetWorkerClass  override    (declared in HttpServer)

 

method GetWorkerClass: Type

 

Type GetWorkerClass()

 

func GetWorkerClass() -> Type

 

Function GetWorkerClass() As Type

HandleHttpRequest  protected override

 

method HandleHttpRequest(connection: Connection; request: HttpServerRequest; response: HttpServerResponse)

 

void HandleHttpRequest(Connection connection, HttpServerRequest request, HttpServerResponse response)

 

func HandleHttpRequest(_ connection: Connection, _ request: HttpServerRequest, _ response: HttpServerResponse)

 

Sub HandleHttpRequest(connection As Connection, request As HttpServerRequest, response As HttpServerResponse)

Parameters:

  • connection:
  • request:
  • response:

HttpRequest    (declared in HttpServer)

 

event HttpRequest: HttpRequestEventHandler
delegate: method HttpRequest(sender: Object; e: HttpRequestEventArgs)

 

delegate HttpRequestEventHandler HttpRequest()
delegate: void HttpRequest(Object sender, HttpRequestEventArgs e)

 

__event HttpRequestEventHandler: HttpRequest!
delegate: func HttpRequest(_ sender: Object, _ e: HttpRequestEventArgs)

 

Event HttpRequest As HttpRequestEventHandler
delegate: Sub HttpRequest(sender As Object, e As HttpRequestEventArgs)

KeepAlive  virtual    (declared in HttpServer)

Controls whether to use HTTP Keep-Alive to keep the connection alive between requests.
If enabled (true), once a request is made and a connection is established, this connection is kept open and used for future requests.
If disabled, the connection is closed, and a new connection is created for future requests.
Since establishing a connection is - relatively speaking - a costly and resource intensive operation for the network, compared to sending small amounts of data, it is recommended to keep this option enabled for optimal performance, if requests to the server are done relatively frequently.
For Keep-Alive to work, the option must be supported and enabled on both client and server.

 

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

 

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

 

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

 

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

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

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

RootPath  virtual

Path that contains the files to be served

 

property RootPath: String read write;

 

String RootPath { get; set; }

 

var RootPath: String { get{} set{} }

 

Property RootPath() As String

ServerName  virtual    (declared in HttpServer)

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue('InternetPack HTTP Server')]
property ServerName: String read write;
// Island
property ServerName: String read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(\"InternetPack HTTP Server\")]
String ServerName { get; set; }
// Island
String ServerName { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(\"InternetPack HTTP Server\")
var ServerName: String { get{} set{} }
// Island, Toffee
var ServerName: String { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(\"InternetPack HTTP Server\")>
Property ServerName() As String
// Island
Property ServerName() As String

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

TriggerHttpRequest  protected virtual    (declared in HttpServer)

 

method TriggerHttpRequest(e: HttpRequestEventArgs)

 

void TriggerHttpRequest(HttpRequestEventArgs e)

 

func TriggerHttpRequest(_ e: HttpRequestEventArgs)

 

Sub TriggerHttpRequest(e As HttpRequestEventArgs)

Parameters:

  • e:

ValidateRequests  virtual    (declared in HttpServer)

 

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

 

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

 

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

 

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

 

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

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

KeepAlive  virtual    (declared in HttpServer)

Controls whether to use HTTP Keep-Alive to keep the connection alive between requests.
If enabled (true), once a request is made and a connection is established, this connection is kept open and used for future requests.
If disabled, the connection is closed, and a new connection is created for future requests.
Since establishing a connection is - relatively speaking - a costly and resource intensive operation for the network, compared to sending small amounts of data, it is recommended to keep this option enabled for optimal performance, if requests to the server are done relatively frequently.
For Keep-Alive to work, the option must be supported and enabled on both client and server.

 

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

 

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

 

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

 

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

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

RootPath  virtual

Path that contains the files to be served

 

property RootPath: String read write;

 

String RootPath { get; set; }

 

var RootPath: String { get{} set{} }

 

Property RootPath() As String

ServerName  virtual    (declared in HttpServer)

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue('InternetPack HTTP Server')]
property ServerName: String read write;
// Island
property ServerName: String read write;

 

// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(\"InternetPack HTTP Server\")]
String ServerName { get; set; }
// Island
String ServerName { get; set; }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(\"InternetPack HTTP Server\")
var ServerName: String { get{} set{} }
// Island, Toffee
var ServerName: String { get{} set{} }

 

// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(\"InternetPack HTTP Server\")>
Property ServerName() As String
// Island
Property ServerName() As String

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

ValidateRequests  virtual    (declared in HttpServer)

 

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

 

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

 

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

 

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

 

constructor .NET, .NET Core 5.0, .NET Standard 2.0, Island

 

constructor

 

SimpleHttpServer()

 

init()

 

Sub New()

Close  virtual    (declared in Server)

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

 

method Close

 

void Close()

 

func Close()

 

Sub Close()

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:

GetWorkerClass  override    (declared in HttpServer)

 

method GetWorkerClass: Type

 

Type GetWorkerClass()

 

func GetWorkerClass() -> Type

 

Function GetWorkerClass() As Type

HandleHttpRequest  protected override

 

method HandleHttpRequest(connection: Connection; request: HttpServerRequest; response: HttpServerResponse)

 

void HandleHttpRequest(Connection connection, HttpServerRequest request, HttpServerResponse response)

 

func HandleHttpRequest(_ connection: Connection, _ request: HttpServerRequest, _ response: HttpServerResponse)

 

Sub HandleHttpRequest(connection As Connection, request As HttpServerRequest, response As HttpServerResponse)

Parameters:

  • connection:
  • request:
  • response:

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

TriggerHttpRequest  protected virtual    (declared in HttpServer)

 

method TriggerHttpRequest(e: HttpRequestEventArgs)

 

void TriggerHttpRequest(HttpRequestEventArgs e)

 

func TriggerHttpRequest(_ e: HttpRequestEventArgs)

 

Sub TriggerHttpRequest(e As HttpRequestEventArgs)

Parameters:

  • e:

 

HttpRequest    (declared in HttpServer)

 

event HttpRequest: HttpRequestEventHandler
delegate: method HttpRequest(sender: Object; e: HttpRequestEventArgs)

 

delegate HttpRequestEventHandler HttpRequest()
delegate: void HttpRequest(Object sender, HttpRequestEventArgs e)

 

__event HttpRequestEventHandler: HttpRequest!
delegate: func HttpRequest(_ sender: Object, _ e: HttpRequestEventArgs)

 

Event HttpRequest As HttpRequestEventHandler
delegate: Sub HttpRequest(sender As Object, e As HttpRequestEventArgs)