Back to product page

WebSocketReceiveText method


Receives text from WebSocket.

Type

String

Syntax

  • C#
  • VB.NET
String WebSocketReceiveText(long Count[=0]);
The WebSocketReceiveText(Count) syntax has these parts:
CountLong value. Determines number of bytes to receive. You can use 0 for all available bytes (default value).
Return valueReceived data provided as String value.

Sub WebSocketReceiveText(ByVal Count As Long) As String
The WebSocketReceiveText(Count) syntax has these parts:
CountLong value. Determines number of bytes to receive. You can use 0 for all available bytes (default value).
Return valueReceived data provided as String value.

Remarks

This method allows you to read data previously arrived through the websocket. While data was arriving, WebSocketDataEvent event fired (more than once, perhaps), and you can allow wodWebServer.NET to buffer the data as it comes. When you're ready to consume it, call this method.

Best moment to use this method is when WebSocketDataEvent event has FrameSize argument set to frame size - at which point you know frame is complete and you should read it and process in some way.

To send data back to websocket, use WebSocketSendText method.

Platforms

Windows