Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AcceptWebSocketRequest Method (Func(AspNetWebSocketContext, Task), AspNetWebSocketOptions)

HttpContext.AcceptWebSocketRequest Method (Func(Of AspNetWebSocketContext, Task), AspNetWebSocketOptions)

.NET Framework 4.6 and 4.5

Accepts an AspNetWebSocket request using the specified user function and options object.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)

'Declaration
Public Sub AcceptWebSocketRequest ( _
	userFunc As Func(Of AspNetWebSocketContext, Task), _
	options As AspNetWebSocketOptions _
)

Parameters

userFunc
Type: System.Func(Of AspNetWebSocketContext, Task)

The user function.

options
Type: System.Web.WebSockets.AspNetWebSocketOptions

The options object.

ExceptionCondition
ArgumentNullException

The userFunc parameter is Nothing.

NotSupportedException

The request is not an AspNetWebSocket request.

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft