SimpleServer demo
Posted: Tue Mar 24, 2020 5:18 pm
Hi,
I tried the Simpleserver demo and was able to connect to the webscoket server without issues. Then I tried to send a message using CEFServerComponent.SendWebSocketMessage but got issues on how the string is displayed in the websocket website. My code looks like this:
but the message that is displayed in https://www.websocket.org/echo.html looks like below:

Do you have an idea how to send the message correctly?
Thank you in advance.
I tried the Simpleserver demo and was able to connect to the webscoket server without issues. Then I tried to send a message using CEFServerComponent.SendWebSocketMessage but got issues on how the string is displayed in the websocket website. My code looks like this:
Code: Select all
procedure TSimpleServerFrm.CEFServerComponent1WebSocketConnected(
Sender: TObject; const server: ICefServer; connection_id: Integer);
var
TempData: string;
begin
TempData := 'Hey connected!';
CEFServerComponent1.SendWebSocketMessage(connection_id, @TempData[1], length(TempData) * SizeOf(Char));
end;

Do you have an idea how to send the message correctly?
Thank you in advance.