Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
CURL.WebSocketReceive
Receive WebSocket data.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CURL | 13.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "CURL.WebSocketReceive"; curl { ; BufferSize } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
curl | The CURL session handle. | $curl | |
BufferSize | The buffer size to use. Default is 65536 and minimum is 1024. |
Optional |
Result
Returns JSON or error.
Description
Receive WebSocket data.Retrieves as much as possible of a received WebSocket data fragment into the buffer, but not more than BufferSize bytes. The bytesReceived value in the returned JSON is set to the number of bytes actually stored.
If there is more fragment data to deliver than what fits in the provided buffer, CURL returns a full buffer and the application needs to call this function again to continue draining the buffer.
The returned JSON contains the data and the metadata about the received data.
This includes the following fields:
Offset | The offset of this data into the frame. |
BytesLeft | Number of pending bytes left of the payload. |
BytesReceived | The number of bytes received. |
Flags | Flags for this packet. |
FlagText | True, if this is text. |
FlagBinary | True, if this is binary. |
FlagContinue | True, if this is not the final fragment of the message, which implies that there will be another fragment coming as part of the same message where this bit is not set. |
FlagClose | True, if this closes the transfer. |
FlagPing | True, if this is a ping. |
FlagPong | True, if this is a pong. |
FlagOffset | True, if this is a partial fragment. |
Data | The data received, hex encoded. |
Text | The data read as UTF-8 text, if possible. |
Examples
Read websocket:
Set Variable [ $result ; Value: MBS("CURL.WebSocketReceive"; $curl) ]
Example result:
{
"Offset": 11,
"BytesLeft": 0,
"BytesReceived": 11,
"Flags": 2,
"FlagText": false,
"FlagBinary": true,
"FlagContinue": false,
"FlagClose": false,
"FlagPing": false,
"FlagPong": false,
"FlagOffset": false,
"Data": "48656C6C6F20576F726C64",
"Text": "Hello World"
}
See also
Release notes
- Version 13.0
- Added CURL.SetOptionWebSocketOptions, CURL.WebSocketReceive and CURL.WebSocketSend functions.
Blog Entries
- New in MBS FileMaker Plugin 13.0
- Neues MBS Plugin 13.0 für Claris FileMaker
- MBS Plugin 13.0 for Claris FileMaker
- MBS FileMaker Plugin, version 12.6pr3
This function checks for a license.
Created 11st December 2022, last changed 11st December 2022