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?
WebSocketConnectEvent event
Fires when request for WebSocket connection arrives.
Syntax
- C#
- VB.NET
delegate void WebSocketConnectDelegate(object Sender, WebSocketConnectArgs Args);
The WebSocketConnectEvent(Args.Action,Args.User) syntax has these parts:
The WebSocketConnectEvent(Args.Action,Args.User) syntax has these parts:
Args.Action | WebActions enumeration value. Determines if websocket is accepted. |
Args.User | WebUser object. Reference to the user who is connected to the server. |
Delegate Sub WebSocketConnectDelegate(ByVal Sender as Object, ByVal Args As WebSocketConnectArgs)
The WebSocketConnectEvent(Args.Action,Args.User) syntax has these parts:
The WebSocketConnectEvent(Args.Action,Args.User) syntax has these parts:
Args.Action | WebActions enumeration value. Determines if websocket is accepted. |
Args.User | WebUser object. Reference to the user who is connected to the server. |
Remarks
This event is fired 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 WebSocketDataEvent event.