The OnError event handler is invoked whenever an error
occurs while an event is being processed by the server. To implement
an event handler, the application should create a class derived from
the CInternetServer class, and then override this method.
It is important to note that this event is not raised for every
error that occurs. The event only occurs when another event is being
processed and an unhandled error occurs that must be reported back to
the server application. The following are some common situations
in which this event handler may be invoked:
- A network error occurs when the client connection is being
accepted by the server. This could be the result of an aborted
connection or some other lower-level failure reported by the
networking subsystem on the server.
- The server is configured to use implicit TLS but cannot obtain
the security credentials required to create the security context for
the session. Usually this indicates that the server certificate
cannot be found, or the certificate does not have a private key
associated with it. It could also indicate a general problem with
the cryptographic subsystem where the client and server could not
successfully negotiate a cipher suite.
- Network errors that may occur when attempting to buffer data
sent by the client. This usually indicates that the connection to
the client has been aborted, either because the client is not
acknowledging the data that has been exchanged with the server, or
the client has terminated abnormally. This event will not occur if
the client terminates the connection normally.
In most situations where this event handler is invoked, the error
is not recoverable and the only action that can be taken is to
terminate the client session.