Back to product page
- Introduction
- License agreement
- Classes
- Enumerations
- Exceptions
- WeOnlyDo.Server.WebServer
- WeOnlyDo.Server.WebHeader
- WeOnlyDo.Server.WebHeaders
- WeOnlyDo.Server.WebRequest
- WeOnlyDo.Server.WebResponse
- WeOnlyDo.Server.WebSessions
- WeOnlyDo.Server.WebSessionVar
- WeOnlyDo.Server.WebSessionVars
- WeOnlyDo.Server.WebUpload
- WeOnlyDo.Server.WebUploads
- WeOnlyDo.Server.WebUser
- WeOnlyDo.Server.WebUsers
- How to get support?
WebSocketDataEvent event
Fires when data arrives on WebSocket.
Syntax
- C
- VB.NET
delegate void WebSocketDataDelegate(object Sender, WebSocketDataArgs Args);
The WebSocketDataEvent(Args.FrameSize,Args.PartSize,Args.IsText,Args.User) syntax has these parts:
The WebSocketDataEvent(Args.FrameSize,Args.PartSize,Args.IsText,Args.User) syntax has these parts:
Args.FrameSize | Integer 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! |
Args.PartSize | Integer value. Size of current 'chunk' of data arrived from the user. |
Args.IsText | Boolean value. Set to True is data is declared as text. |
Args.User | WebUser object. Reference to the user who is connected to the server. |
Delegate Sub WebSocketDataDelegate(ByVal Sender as Object, ByVal Args As WebSocketDataArgs)
The WebSocketDataEvent(Args.FrameSize,Args.PartSize,Args.IsText,Args.User) syntax has these parts:
The WebSocketDataEvent(Args.FrameSize,Args.PartSize,Args.IsText,Args.User) syntax has these parts:
Args.FrameSize | Integer 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! |
Args.PartSize | Integer value. Size of current 'chunk' of data arrived from the user. |
Args.IsText | Boolean value. Set to True is data is declared as text. |
Args.User | WebUser object. Reference to the user who is connected to the server. |
Remarks
After you have accepted websocket connection, client may start to send you data. As data arrives, this event fires. Data may be fragmented, and this event is fired for each fragment. PartSize argument will always have size of current fragment. If there are more parts or chunks expected to arrive, FrameSize will be 0.When full data arrives that form a Frame, FrameSize argument will contain size of full fragment.
You should use WebSocketReceiveText method to read incoming data anytime you wish, inside or outside of this event.