TsgcWebSocketServer_HTTPAPIEvents › OnUnknownProtocol

OnUnknownProtocol Event

Not currently supported by the HTTP API server; declared for API compatibility with TsgcWebSocketServer.

Syntax

public event TsgcWSUnknownProtocolEventHandler OnUnknownProtocol;
// delegate void TsgcWSUnknownProtocolEventHandler(TsgcWSConnection Connection, out bool Accept)

Default Value

Remarks

OnUnknownProtocol is declared on the HTTP API server for source compatibility with TsgcWebSocketServer but it is not currently fired: the HTTP.SYS kernel driver dispatches incoming requests by URL reservation rather than by sniffing the first bytes, so unknown protocols are simply rejected by HTTP.SYS before the component can raise the event. To accept raw TCP clients use the classic TsgcWebSocketServer; this event is retained here to keep user code portable between the two servers.

Example


void OnUnknownProtocol(TsgcWSConnection Connection, ref bool Accept)
{
  // not invoked by the HTTP API server; provided for API compatibility
  Accept = true;
}

Back to Events