C# Class WebSocket.Portable.WebSocketBase

Inheritance: ICanLog, IWebSocket
显示文件 Open project: NVentimiglia/WebSocket.Portable

Public Methods

Method Description
CloseAsync ( WebSocketErrorCode errorCode ) : Task
ConnectAsync ( string uri, int port, bool useSSL ) : Task

Connects asynchronous.

ConnectAsync ( string uri, int port, bool useSSL, CancellationToken cancellationToken ) : Task

Connects asynchronous.

Dispose ( ) : void
ReceiveFrameAsync ( ) : Task
ReceiveFrameAsync ( CancellationToken cancellationToken ) : Task
RegisterExtension ( IWebSocketExtension extension ) : void
SendFrameAsync ( IWebSocketFrame frame ) : Task
SendFrameAsync ( IWebSocketFrame frame, CancellationToken cancellationToken ) : Task
SendHandshakeAsync ( ) : Task

Sends the default handshake asynchronous.

SendHandshakeAsync ( CancellationToken cancellationToken ) : Task

Sends the default handshake asynchronous.

SendHandshakeAsync ( WebSocket.Portable.WebSocketRequestHandshake handshake ) : Task

Sends the handshake asynchronous.

SendHandshakeAsync ( WebSocket.Portable.WebSocketRequestHandshake handshake, CancellationToken cancellationToken ) : Task

Sends the handshake asynchronous.

SetSubProtocol ( string subProtocol ) : void

Protected Methods

Method Description
ConnectAsyncInternal ( string host, int port, bool useSsl, CancellationToken cancellationToken ) : Task

Connects asynchronous.

WebSocketBase ( ) : System

Prevents a default instance of the WebSocketBase class from being created.

Private Methods

Method Description
SendAsync ( byte buffer, int offset, int length, CancellationToken cancellationToken ) : Task

Sends data asynchronous.

SendAsync ( string data, Encoding encoding, CancellationToken cancellationToken ) : Task

Sends data asynchronous.

Method Details

CloseAsync() public method

public CloseAsync ( WebSocketErrorCode errorCode ) : Task
errorCode WebSocketErrorCode
return Task

ConnectAsync() public method

Connects asynchronous.
public ConnectAsync ( string uri, int port, bool useSSL ) : Task
uri string The URI.
port int
useSSL bool
return Task

ConnectAsync() public method

Connects asynchronous.
Cannot connect because current state is + _state
public ConnectAsync ( string uri, int port, bool useSSL, CancellationToken cancellationToken ) : Task
uri string The URI.
port int
useSSL bool
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

ConnectAsyncInternal() protected abstract method

Connects asynchronous.
protected abstract ConnectAsyncInternal ( string host, int port, bool useSsl, CancellationToken cancellationToken ) : Task
host string The host.
port int The port.
useSsl bool if set to true [use SSL].
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

Dispose() public method

public Dispose ( ) : void
return void

ReceiveFrameAsync() public method

public ReceiveFrameAsync ( ) : Task
return Task

ReceiveFrameAsync() public method

public ReceiveFrameAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
return Task

RegisterExtension() public method

public RegisterExtension ( IWebSocketExtension extension ) : void
extension IWebSocketExtension
return void

SendFrameAsync() public method

public SendFrameAsync ( IWebSocketFrame frame ) : Task
frame IWebSocketFrame
return Task

SendFrameAsync() public method

public SendFrameAsync ( IWebSocketFrame frame, CancellationToken cancellationToken ) : Task
frame IWebSocketFrame
cancellationToken System.Threading.CancellationToken
return Task

SendHandshakeAsync() public method

Sends the default handshake asynchronous.
public SendHandshakeAsync ( ) : Task
return Task

SendHandshakeAsync() public method

Sends the default handshake asynchronous.
public SendHandshakeAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

SendHandshakeAsync() public method

Sends the handshake asynchronous.
public SendHandshakeAsync ( WebSocket.Portable.WebSocketRequestHandshake handshake ) : Task
handshake WebSocket.Portable.WebSocketRequestHandshake The handshake.
return Task

SendHandshakeAsync() public method

Sends the handshake asynchronous.
public SendHandshakeAsync ( WebSocket.Portable.WebSocketRequestHandshake handshake, CancellationToken cancellationToken ) : Task
handshake WebSocket.Portable.WebSocketRequestHandshake The handshake.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

SetSubProtocol() public method

public SetSubProtocol ( string subProtocol ) : void
subProtocol string
return void

WebSocketBase() protected method

Prevents a default instance of the WebSocketBase class from being created.
protected WebSocketBase ( ) : System
return System