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
Public method Connection(String) Initializes a new instance of the Connection class.
Public method Connection(String, IDictionary<String, String>) Initializes a new instance of the Connection class.
Public method Connection(String, String) Initializes a new instance of the Connection class.

Top

Properties

  Name Description
Public property ConnectionId Gets or sets the connection id for the connection.
Public property ConnectionToken Gets or sets the connection token for the connection.
Public property CookieContainer Gets or sets the cookies associated with the connection.
Public property Credentials Gets or sets authentication information for the connection.
Public property GroupsToken Gets or sets the groups token for the connection.
Public property Headers Gets or sets the headers for the requests
Public property Items Gets a dictionary for storing state for the connection.
Public property JsonSerializer Gets or sets the serializer used by the connection.
Public property MessageId Gets or sets the last message id for the connection.
Public property Protocol Gets or sets the protocol for the connection.
Public property Proxy Gets or sets the proxy information for the connection.
Public property QueryString Gets the query string specified in the constructor.
Public property State Gets the current ConnectionState of the connection.
Public property TraceLevel Gets or sets the trace level for the connection.
Public property TraceWriter Gets or sets the text writer to trace the connection.
Public property Transport Gets or sets the client transport for the connection.
Public property TransportConnectTimeout Gets or sets a TimeSpan representing the amount of time to transport connection before timing out.
Public property Url Gets or sets the url for the connection.

Top

Methods

  Name Description
Public method AddClientCertificate Adds a client certificate to the request.
Public method Dispose() Stop the connection, equivalent to calling connection stop.
Protected method Dispose(Boolean) Stop the connection, equivalent to calling connection stop.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Protected method OnClosed
Protected method OnMessageReceived Called when the Connection has received message from the server.
Public method OnReconnecting
Protected method OnSending Called when the Connection sends an alert or reminder notifications.
Public method Send(Object) Sends an object that will be JSON serialized asynchronously over the connection.
Public method Send(String) Sends data asynchronously over the connection.
Public method Start() Starts the Connection.
Public method Start(IClientTransport) Starts the Connection.
Public method Start(IHttpClient) Starts the Connection.
Public method Stop() Stops the Connection and sends an abort message to the server.
Public method Stop(TimeSpan) Stops the Connection and sends an abort message to the server. <param name="timeout">The timeout</param>.
Public method ToString (Inherited from Object.)
Public method Trace Traces a connection method that is specified by the parameters.

Top

Events

  Name Description
Public event Closed Occurs when connection is stopped.
Public event ConnectionSlow Occurs when the Connection is about to timeout.
Public event Error Occurs when the Connection has encountered an error.
Public event Received Occurs when the Connection has received data from the server.
Public event Reconnected Occurs when the Connection successfully reconnects after a timeout.
Public event Reconnecting Occurs when the Connection starts reconnecting after an error.
Public event StateChanged Occurs when the Connection state changes.

Top

Extension Methods

  Name Description
Public Extension Method AsObservable() Overloaded. (Defined by ConnectionExtensions.)
Public Extension Method AsObservable<T>() Overloaded. (Defined by ConnectionExtensions.)
Public Extension Method AsObservable<T>(Func<String, T>) Overloaded. (Defined by ConnectionExtensions.)
Public Extension Method EnsureReconnecting (Defined by ConnectionExtensions.)
Public Extension Method GetValue<T> (Defined by ConnectionExtensions.)
Public Extension Method JsonDeserializeObject<T> (Defined by ConnectionExtensions.)
Public Extension Method JsonSerializeObject (Defined by ConnectionExtensions.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate property IConnection.Certificates Gets a collection that stores X509Certificate objects.
Explicit interface implemetationPrivate method IConnection.ChangeState Called when the connection to change state.
Explicit interface implemetationPrivate method 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.
Explicit interface implemetationPrivate property IConnection.KeepAliveData Gets or sets an object to store the various keep alive timeout values.
Explicit interface implemetationPrivate method IConnection.OnConnectionSlow Called when the Connection is about to timeout.
Explicit interface implemetationPrivate method IConnection.OnError Called when the Connection has encountered an error.
Explicit interface implemetationPrivate method IConnection.OnReceived Called when the Connection has received data from the server.
Explicit interface implemetationPrivate method IConnection.OnReconnected Called when the Connection successfully reconnects after a timeout.
Explicit interface implemetationPrivate method IConnection.PrepareRequest Prepares all request for the Connection.
Explicit interface implemetationPrivate method 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.

See Also

Reference

Microsoft.AspNet.SignalR.Client Namespace