Connection Class
.NET Framework 4.5
Provides client connections for SignalR services.
Inheritance Hierarchy
System.Object
Microsoft.AspNet.SignalR.Client.Connection
Microsoft.AspNet.SignalR.Client.HubConnection
Namespace: Microsoft.AspNet.SignalR.Client
Assembly: Microsoft.AspNet.SignalR.Client (in Microsoft.AspNet.SignalR.Client.dll)
Syntax
'Declaration
Public Class Connection _
Implements IConnection, IDisposable
'Usage
Dim instance As Connection
public class Connection : IConnection, IDisposable
public ref class Connection : IConnection,
IDisposable
type Connection =
class
interface IConnection
interface IDisposable
end
public class Connection implements IConnection, IDisposable
The Connection type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Connection(String) | Initializes a new instance of the Connection class. | |
Connection(String, IDictionary<String, String>) | Initializes a new instance of the Connection class. | |
Connection(String, String) | Initializes a new instance of the Connection class. |
Top
Properties
Name | Description | |
---|---|---|
ConnectionId | Gets or sets the connection id for the connection. | |
ConnectionToken | Gets or sets the connection token for the connection. | |
CookieContainer | Gets or sets the cookies associated with the connection. | |
Credentials | Gets or sets authentication information for the connection. | |
GroupsToken | Gets or sets the groups token for the connection. | |
Headers | Gets or sets the headers for the requests | |
Items | Gets a dictionary for storing state for the connection. | |
JsonSerializer | Gets or sets the serializer used by the connection. | |
MessageId | Gets or sets the last message id for the connection. | |
Protocol | Gets or sets the protocol for the connection. | |
Proxy | Gets or sets the proxy information for the connection. | |
QueryString | Gets the query string specified in the constructor. | |
State | Gets the current ConnectionState of the connection. | |
TraceLevel | Gets or sets the trace level for the connection. | |
TraceWriter | Gets or sets the text writer to trace the connection. | |
Transport | Gets or sets the client transport for the connection. | |
TransportConnectTimeout | Gets or sets a TimeSpan representing the amount of time to transport connection before timing out. | |
Url | Gets or sets the url for the connection. |
Top
Methods
Name | Description | |
---|---|---|
AddClientCertificate | Adds a client certificate to the request. | |
Dispose() | Stop the connection, equivalent to calling connection stop. | |
Dispose(Boolean) | Stop the connection, equivalent to calling connection stop. | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
OnClosed | ||
OnMessageReceived | Called when the Connection has received message from the server. | |
OnReconnecting | ||
OnSending | Called when the Connection sends an alert or reminder notifications. | |
Send(Object) | Sends an object that will be JSON serialized asynchronously over the connection. | |
Send(String) | Sends data asynchronously over the connection. | |
Start() | Starts the Connection. | |
Start(IClientTransport) | Starts the Connection. | |
Start(IHttpClient) | Starts the Connection. | |
Stop() | Stops the Connection and sends an abort message to the server. | |
Stop(TimeSpan) | Stops the Connection and sends an abort message to the server. <param name="timeout">The timeout</param>. | |
ToString | (Inherited from Object.) | |
Trace | Traces a connection method that is specified by the parameters. |
Top
Events
Name | Description | |
---|---|---|
Closed | Occurs when connection is stopped. | |
ConnectionSlow | Occurs when the Connection is about to timeout. | |
Error | Occurs when the Connection has encountered an error. | |
Received | Occurs when the Connection has received data from the server. | |
Reconnected | Occurs when the Connection successfully reconnects after a timeout. | |
Reconnecting | Occurs when the Connection starts reconnecting after an error. | |
StateChanged | Occurs when the Connection state changes. |
Top
Extension Methods
Name | Description | |
---|---|---|
AsObservable() | Overloaded. (Defined by ConnectionExtensions.) | |
AsObservable<T>() | Overloaded. (Defined by ConnectionExtensions.) | |
AsObservable<T>(Func<String, T>) | Overloaded. (Defined by ConnectionExtensions.) | |
EnsureReconnecting | (Defined by ConnectionExtensions.) | |
GetValue<T> | (Defined by ConnectionExtensions.) | |
JsonDeserializeObject<T> | (Defined by ConnectionExtensions.) | |
JsonSerializeObject | (Defined by ConnectionExtensions.) |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
IConnection.Certificates | Gets a collection that stores X509Certificate objects. | |
IConnection.ChangeState | Called when the connection to change state. | |
IConnection.Disconnect | 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.KeepAliveData | Gets or sets an object to store the various keep alive timeout values. | |
IConnection.OnConnectionSlow | Called when the Connection is about to timeout. | |
IConnection.OnError | Called when the Connection has encountered an error. | |
IConnection.OnReceived | Called when the Connection has received data from the server. | |
IConnection.OnReconnected | Called when the Connection successfully reconnects after a timeout. | |
IConnection.PrepareRequest | Prepares all request for the Connection. | |
IConnection.UpdateLastKeepAlive | Sets LastKeepAlive to the current time. |
Top
Remarks
No content here will be updated; please do not add material here.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.