HttpContextBase.AcceptWebSocketRequest Method

Definition

When implemented in a derived class, accepts an AspNetWebSocket request.

Overloads

AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>)

When implemented in a derived class, accepts an AspNetWebSocket request using the specified user function.

AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>, AspNetWebSocketOptions)

When implemented in a derived class, accepts an AspNetWebSocket request using the specified user function and options object.

AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>)

When implemented in a derived class, accepts an AspNetWebSocket request using the specified user function.

C#
public virtual void AcceptWebSocketRequest(Func<System.Web.WebSockets.AspNetWebSocketContext,System.Threading.Tasks.Task> userFunc);

Parameters

userFunc
Func<AspNetWebSocketContext,Task>

The user function.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

AcceptWebSocketRequest(Func<AspNetWebSocketContext,Task>, AspNetWebSocketOptions)

When implemented in a derived class, accepts an AspNetWebSocket request using the specified user function and options object.

C#
public virtual void AcceptWebSocketRequest(Func<System.Web.WebSockets.AspNetWebSocketContext,System.Threading.Tasks.Task> userFunc, System.Web.WebSockets.AspNetWebSocketOptions options);

Parameters

userFunc
Func<AspNetWebSocketContext,Task>

The user function.

options
AspNetWebSocketOptions

The options object.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1