C# Class Microsoft.AspNet.SignalR.Client.Connection

Inheritance: IConnection
显示文件 Open project: SignalR/SignalR Class Usage Examples

Private Properties

Property Type Description
ChangeState bool
CreateQueryString string
CreateUserAgentString string
Disconnect void
IConnection bool
IConnection void
IConnection void
IConnection void
IConnection void
Negotiate Task
OnError void
OnMessageReceived void
OnReconnecting void
SetTimeout IDisposable
Start Task
StartTransport Task
Stop void
Stop void
TryParseVersion bool
VerifyProtocolVersion void

Public Methods

Method Description
AddClientCertificate ( X509Certificate certificate ) : void

Adds a client certificate to the request

Connection ( string url ) : System

Initializes a new instance of the Connection class.

Connection ( string url, string>.IDictionary queryString ) : System

Initializes a new instance of the Connection class.

Connection ( string url, string queryString ) : System

Initializes a new instance of the Connection class.

Dispose ( ) : void

Stop the connection, equivalent to calling connection.stop

Send ( object value ) : Task

Sends an object that will be JSON serialized asynchronously over the connection.

Send ( string data ) : Task

Sends data asynchronously over the connection.

Start ( ) : Task

Starts the Connection.

Start ( IClientTransport transport ) : Task

Starts the Connection.

Stop ( ) : void

Stops the Connection and sends an abort message to the server.

Stop ( Exception error ) : void

Stops the Connection and sends an abort message to the server. The error due to which the connection is being stopped.

Trace ( TraceLevels level, string format ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Stop the connection, equivalent to calling connection.stop

OnClosed ( ) : void
OnSending ( ) : string

Private Methods

Method Description
ChangeState ( ConnectionState oldState, ConnectionState newState ) : bool
CreateQueryString ( string>.IDictionary queryString ) : string
CreateUserAgentString ( string client ) : string
Disconnect ( ) : void
IConnection ( ConnectionState oldState, ConnectionState newState ) : bool
IConnection ( ) : void

Stops the Connection without sending an abort message to the server. This function is called after we receive a disconnect message from the server.

IConnection ( Exception error ) : void
IConnection ( IRequest request ) : void
IConnection ( JToken message ) : void
Negotiate ( IClientTransport transport ) : Task
OnError ( Exception error ) : void
OnMessageReceived ( JToken message ) : void
OnReconnecting ( ) : void
SetTimeout ( System.TimeSpan delay, System.Action operation ) : IDisposable
Start ( IHttpClient httpClient ) : Task
StartTransport ( ) : Task
Stop ( Exception error, System.TimeSpan timeout ) : void
Stop ( System.TimeSpan timeout ) : void
TryParseVersion ( string versionString, Version &version ) : bool
VerifyProtocolVersion ( string versionString ) : void

Method Details

AddClientCertificate() public method

Adds a client certificate to the request
public AddClientCertificate ( X509Certificate certificate ) : void
certificate System.Security.Cryptography.X509Certificates.X509Certificate Client Certificate
return void

Connection() public method

Initializes a new instance of the Connection class.
public Connection ( string url ) : System
url string The url to connect to.
return System

Connection() public method

Initializes a new instance of the Connection class.
public Connection ( string url, string>.IDictionary queryString ) : System
url string The url to connect to.
queryString string>.IDictionary The query string data to pass to the server.
return System

Connection() public method

Initializes a new instance of the Connection class.
public Connection ( string url, string queryString ) : System
url string The url to connect to.
queryString string The query string data to pass to the server.
return System

Dispose() public method

Stop the connection, equivalent to calling connection.stop
public Dispose ( ) : void
return void

Dispose() protected method

Stop the connection, equivalent to calling connection.stop
protected Dispose ( bool disposing ) : void
disposing bool Set this to true to perform the dispose, false to do nothing
return void

OnClosed() protected method

protected OnClosed ( ) : void
return void

OnSending() protected method

protected OnSending ( ) : string
return string

Send() public method

Sends an object that will be JSON serialized asynchronously over the connection.
public Send ( object value ) : Task
value object The value to serialize.
return Task

Send() public method

Sends data asynchronously over the connection.
public Send ( string data ) : Task
data string The data to send.
return Task

Start() public method

Starts the Connection.
public Start ( ) : Task
return Task

Start() public method

Starts the Connection.
public Start ( IClientTransport transport ) : Task
transport IClientTransport The transport to use.
return Task

Stop() public method

Stops the Connection and sends an abort message to the server.
public Stop ( ) : void
return void

Stop() public method

Stops the Connection and sends an abort message to the server. The error due to which the connection is being stopped.
public Stop ( Exception error ) : void
error System.Exception
return void

Trace() public method

public Trace ( TraceLevels level, string format ) : void
level TraceLevels
format string
return void