Click or drag to resize

HttpServer Class

HTTP Server
Inheritance Hierarchy
SystemObject
  Crestron.SimplSharp.NetServer
    Crestron.SimplSharp.Net.HttpHttpServer

Namespace: Crestron.SimplSharp.Net.Http
Assembly: SimplSharpHelperInterface (in SimplSharpHelperInterface.dll) Version: 2.21.121
Syntax
C#
public class HttpServer : Server

The HttpServer type exposes the following members.

Constructors
 NameDescription
Public methodHttpServer Creates a new instance of the HttpServer class
Public methodHttpServer(EthernetAdapterType) Creates a new instance of the HttpServer class and allows for providing the desired adapter to bind to
Public methodHttpServer(OnHttpRequestHandler) Creates a new instance of the HttpServer class and registers the incoming parameter as a callback for this HTTP Server object
Public methodHttpServer(OnHttpRequestHandler, EthernetAdapterType) Creates a new instance of the HttpServer class and registers the incoming parameter as a callback for this HTTP Server object
Top
Properties
 NameDescription
Public propertyActive 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)
Public propertyBindingObsolete.
Gets the ServerBinding instance. In most cases, the IPv4 ServerBinding instance is returned.
(Inherited from Server)
Public propertyBindings Gets the current ServerBindings instance. This instance is not used by the Server class itself.
(Inherited from Server)
Public propertyBindingV4 Gets the IPv4 ServerBinding instance. The returned instance can be used to fine-tune the IPv4 server endpoint.
(Inherited from Server)
Public propertyBindingV6 Gets the IPv6 ServerBinding instance. The returned instance can be used to fine-tune the IPv6 server endpoint.
(Inherited from Server)
Public propertyBindV4 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)
Public propertyBindV6 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)
Public propertyCloseConnectionsOnShutdown 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)
Public propertyConnectionClass 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)
Protected propertyDefaultPort Gets or sets the default port number.
(Inherited from Server)
Public propertyEnableNagle 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)
Public propertyEthernetAdapterToBindTo 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)
Public propertyKeepAlive 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.
Public propertyMaxLineLength Gets or sets the default MaxLineLength value for all newly created Connections.
(Inherited from Server)
Public propertyMaxLineLengthEnabled Gets or sets the default MaxLineLengthEnabled value for all newly created Connections.
(Inherited from Server)
Public propertyPort Gets or sets the port number on which the server will listen.
(Inherited from Server)
Public propertyServerName Get or Set the name of the HTTP Server Instance. Defaults to "SimplSharp HTTP Server"
Public propertyTimeout Gets or sets the default Timeout value for all newly created Connections.
(Inherited from Server)
Public propertyTimeoutEnabled Gets or sets the default TimeoutEnabled value for all newly created Connections.
(Inherited from Server)
Public propertyValidateRequests Controls whether HTTP Requests are validated or not.
Top
Methods
 NameDescription
Public methodClose This method causes the server to stop listening for incoming connections.
(Inherited from Server)
Public methodDispose Disposes the Server Connection.
(Inherited from Server)
Protected methodDispose(Boolean) Disposes of the current instance and releases all resources used by it.
(Inherited from Server)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodHandleHttpRequest Handles the HTTP Request for the HTTP server for the specified Connection.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodOpen This method causes the server to start listening for incoming connections.
(Inherited from Server)
Public methodShouldSerializePort Returns true when the DefaultPort is not equal to the Port.
(Inherited from Server)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Events
 NameDescription
Public eventOnHttpRequest This event is fired whenever an HTTP request is received by the server.
Top

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also