Http |
public class HttpServer : Server
The HttpServer type exposes the following members.
| Name | Description | |
|---|---|---|
| HttpServer | Creates a new instance of the HttpServer class | |
| HttpServer(EthernetAdapterType) | Creates a new instance of the HttpServer class and allows for providing the desired adapter to bind to | |
| HttpServer(OnHttpRequestHandler) | Creates a new instance of the HttpServer class and registers the incoming parameter as a callback for this HTTP Server object | |
| HttpServer(OnHttpRequestHandler, EthernetAdapterType) | Creates a new instance of the HttpServer class and registers the incoming parameter as a callback for this HTTP Server object |
| Name | Description | |
|---|---|---|
| Active |
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.
(Inherited from Server) | |
| Binding | Obsolete. Gets the ServerBinding instance. In most cases, the IPv4 ServerBinding instance is returned. (Inherited from Server) | |
| Bindings |
Gets the current ServerBindings instance. This instance is not used by the Server class itself.
(Inherited from Server) | |
| BindingV4 |
Gets the IPv4 ServerBinding instance.
The returned instance can be used to fine-tune the IPv4 server endpoint.
(Inherited from Server) | |
| BindingV6 |
Gets the IPv6 ServerBinding instance.
The returned instance can be used to fine-tune the IPv6 server endpoint.
(Inherited from Server) | |
| BindV4 |
Gets or sets the flag indicating whether the server should listen for IPv4 connections.
Setting this flag doesn't have any immediate effect. It's value is used only when the server is opened
(either by setting the Active property to true or by directly calling the Open method).
(Inherited from Server) | |
| BindV6 |
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).
(Inherited from Server) | |
| CloseConnectionsOnShutdown |
Gets or sets the flag indicating whether the currently open client connections should be appropriately closed on server shutdown.
The default value is true.
(Inherited from Server) | |
| ConnectionClass |
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.
(Inherited from Server) | |
| DefaultPort |
Gets or sets the default port number.
(Inherited from Server) | |
| EnableNagle |
Gets or the sets flag indicating whether the Nagle's algorithm 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).
(Inherited from Server) | |
| EthernetAdapterToBindTo |
Indicates if the user wants to bind to a specific adapter
This is valid on systems which support multiple adapters.
Ignored on systems which do not support multiple adapters.
Only valid if the address of the HTTP server is defined as 0.0.0.0 - Ignored otherwise
Set to EthernetAdapterType.EthernetUnknownAdapter if no specific binding is required.
On units which just have a single adapter - we can accept a connection from anywhere
- In this case this setting is ignored
On units which have multiple adapters
- If the user specified EthernetCSAdapter then accept connection from Control Subnet side only
- If the user specified EthernetLAN2Adapter then accept connection from LAN2 side only
- If the user specified EthernetLANAdapter, then accept connections from anywhere but from the Control subnet side and LAN2
(Inherited from Server) | |
| KeepAlive | 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. | |
| MaxLineLength |
Gets or sets the default MaxLineLength value for all newly created Connections.
(Inherited from Server) | |
| MaxLineLengthEnabled |
Gets or sets the default MaxLineLengthEnabled value for all newly created Connections.
(Inherited from Server) | |
| Port |
Gets or sets the port number on which the server will listen.
(Inherited from Server) | |
| ServerName | Get or Set the name of the HTTP Server Instance. Defaults to "SimplSharp HTTP Server" | |
| Timeout |
Gets or sets the default Timeout value for all newly created Connections.
(Inherited from Server) | |
| TimeoutEnabled |
Gets or sets the default TimeoutEnabled value for all newly created Connections.
(Inherited from Server) | |
| ValidateRequests | Controls whether HTTP Requests are validated or not. |
| Name | Description | |
|---|---|---|
| Close |
This method causes the server to stop listening for incoming connections.
(Inherited from Server) | |
| Dispose |
Disposes the Server Connection.
(Inherited from Server) | |
| Dispose(Boolean) |
Disposes of the current instance and releases all resources used by it.
(Inherited from Server) | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| HandleHttpRequest | Handles the HTTP Request for the HTTP server for the specified Connection. | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
| Open |
This method causes the server to start listening for incoming connections.
(Inherited from Server) | |
| ShouldSerializePort |
Returns true when the DefaultPort is not equal to the Port.
(Inherited from Server) | |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| Name | Description | |
|---|---|---|
| OnHttpRequest | This event is fired whenever an HTTP request is received by the server. |