Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AspNetWebSocket Class

AspNetWebSocket Class

.NET Framework 4.6 and 4.5

Represents a real-time full-duplex connection between a web server and a client in an ASP.NET application.


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

public sealed class AspNetWebSocket : WebSocket

The AspNetWebSocket type exposes the following members.

Public propertyCloseStatusGets a status code that indicates why an AspNetWebSocket object was closed. (Overrides WebSocket.CloseStatus.)
Public propertyCloseStatusDescriptionGets a status message that explains why an AspNetWebSocket object was closed. (Overrides WebSocket.CloseStatusDescription.)
Public propertyStateGets a value that indicates the open or closed state of an AspNetWebSocket object. (Overrides WebSocket.State.)
Public propertySubProtocolGets the name of an application-specific protocol that a remote client and a server can use to exchange data over an AspNetWebSocket connection. (Overrides WebSocket.SubProtocol.)

Public methodAbortCancels any pending I/O operations on the AspNetWebSocket object and sets the state of the object so that it cannot be used to start additional I/O operations. (Overrides WebSocket.Abort().)
Public methodCloseAsyncSends an asynchronous message to a client to close the connection. If the server initiates the request to close the connection, the method waits for the client to acknowledge the request before it returns. (Overrides WebSocket.CloseAsync(WebSocketCloseStatus, String, CancellationToken).)
Public methodCloseOutputAsyncSends an asynchronous message to a client to close the connection. If the server initiates the request to close the connection, the method returns without waiting for a response. (Overrides WebSocket.CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken).)
Public methodDisposeReleases all resources used by an AspNetWebSocket object. (Overrides WebSocket.Dispose().)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodReceiveAsyncReceives a single message fragment from a remote client. (Overrides WebSocket.ReceiveAsync(ArraySegment<Byte>, CancellationToken).)
Public methodSendAsyncSends a single message fragment to a remote client. (Overrides WebSocket.SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken).)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

.NET Framework

Supported in: 4.6, 4.5

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft