variables
{
CHAR gReceiveBuffer[2000];
}
void OnTlsEarlyDataReceived(dword socket, char buffer[], dword size)
{
const dword replySize = 17;
CHAR earlyDataReply[replySize] = "Early data reply";
//
// Do something useful with the data...
//
// Allows the server to directly send data to the unauthenticated client
ipSetSocketOption(socket, "IPPROTO_TCP", "TCP_NODELAY", 1);
TcpSend(socket, earlyDataReply, replySize);
// continue receiving data on the socket
TcpReceive(socket, gReceiveBuffer, elcount(gReceiveBuffer) );
}
void OnTlsHandshakeComplete(dword socket, int result)
{
ipSetSocketOption(socket, "IPPROTO_TCP", "TCP_NODELAY", 0);
}