Discuss this help topic in SecureBlackbox Forum

HTTPS: Connect the server class and the client connection

As TElHTTPSServer doesn't embed a socket, your code is responsible for transferring the data between the socket (or other transport channel) and the TElHTTPSServer. To do this in your code you have to create a loop, in which:

  1. monitor the client connection for incoming data. If the data is available, call TElHTTPSServer.DataAvailable;
  2. in your event handler of OnReceive event read the data from the incoming connection to the buffer, provided via the parameter of the event handler;
  3. in your event handler of OnSend event write the passed data to the socket;
  4. if the error happens, break out of the loop. If the error happens in the event handler, throw an exception and catch it in the loop main code (then break the loop).
After breaking from the loop remember to close the socket (or another transport channel used for a client connection) and also call TElHTTPSServer.Close() method.

How To articles about server-side HTTPS questions

Discuss this help topic in SecureBlackbox Forum