|
|
|
|
|
WLanguage procedure called by WebSocketClientConnectSSL WLanguage procedure ("callback") called by WebSocketClientConnectSSL when the connection to the server is established. This procedure is called in the following cases: - when the connection to the server is established,
- when data is received,
- when the socket is closed,
- when an error occurs.
WARNING: the Procedure is called in the application's main thread: - You can access UI controls from the procedure.
- The process should not be too long, since this could block the user.
WebSocketClientConnectSSL("client", WebSocketClientConnectSSL_Callback, "myserver.com")
INTERNAL PROCEDURE WebSocketClientConnectSSL_Callback(nEvent, sMessage)
SWITCH nEvent
CASE SocketOpening
SocketWrite("client", "Send message from the browser.")
CASE SocketMessage
Info("IncomingData: " + sMessage)
CASE SocketClosing
Info("Socket closed", sMessage)
CASE SocketError
Error("Socket error: " + sMessage)
END
END
Syntax
WebSocketClientConnectSSL_Callback(<Event> , <Message>)
<Event>: Integer constant Corresponds to one of the following constants:
| | SocketClosing | The socket is closed. The <Message> parameter contains a code that indicates the reason for closing. | SocketError | An error occurred during the communication with the server. The <Message> parameter contains the details of the error. | SocketMessage | The socket received a message. The <Message> parameter contains data relative to the message. | SocketOpening | The socket is connected to the server. You have the ability to send messages. |
<Message>: Character string Response from the server according to the <Event>.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|