Back to product page
- Introduction
- License agreement
- Getting Started
- Enumerations
- Objects
- How to get support?
- Technical information
- Fast notifications interface
- Error list
WebSocketData callback method
Called when data arrives on WebSocket.
Syntax
- Basic
object.WebSocketData (Owner, User, IsText, PartSize, FrameSize)
The WebSocketData(object,User,IsText,PartSize,FrameSize) syntax has these parts:
The WebSocketData(object,User,IsText,PartSize,FrameSize) syntax has these parts:
object | An expression evaluating to an object of type IwodWebNotify |
User | WebUser object. Reference to the user who sent the request. |
IsText | Boolean value. Set to True is data is declared as text. |
PartSize | Long value. Size of current 'chunk' of data arrived from the user. |
FrameSize | Long value. Size of full frame (that was possibly chunked) that user wanted to send. Usually denotes full message sent from the client. This value may be empty! |
Remarks
NOTE: This method is called only if you implemented IwodWebNotify interface in your application, and wodWeb1.Notification property has received reference to instance of your implementation.This notification method is called when user wants to upgrade regular HTTP connection to websocket, so it can perform full-duplex communication with the server. You can decide to Accept or Deny the connection. By default, all websocket requests will be denied.
Before accepting you should perform "security" check if you want to trust incoming connection, since it may basically send you any kind of information for which you should decide to accept it or not. Typically, you should check Request Headers to see if they match for what you expect them to be.
You can also use URI to differentiate different websocket requests - based on how you plan to handle them in the code.
Once connection is accepted, when data starts arriving you will get notified using WebSocketData notification method.