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.Hubs.HubConnection

Namespace:  Microsoft.AspNet.SignalR.Client
Assembly:  Microsoft.AspNet.SignalR.Client (in Microsoft.AspNet.SignalR.Client.dll)

Syntax

'Declaration
Public Class Connection _
    Implements IConnection
'Usage
Dim instance As Connection
public class Connection : IConnection
public ref class Connection : IConnection
type Connection =  
    class 
        interface IConnection 
    end
public class Connection implements IConnection

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 Items Gets a dictionary for storing state for a the connection.
Public property MessageId Gets or sets the last message id for the connection.
Public property Proxy Gets of sets 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 Transport
Public property Url Gets the url for the connection.

Top

Methods

  Name Description
Public method Disconnect Stops the Connection without sending an abort message to the server.
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 OnMessageReceived
Protected method OnSending
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 ToString (Inherited from Object.)

Top

Events

  Name Description
Public event Closed Occurs when the Connection is stopped.
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.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IConnection.ChangeState
Explicit interface implemetationPrivate method IConnection.OnError
Explicit interface implemetationPrivate method IConnection.OnReceived
Explicit interface implemetationPrivate method IConnection.OnReconnected
Explicit interface implemetationPrivate method IConnection.OnReconnecting
Explicit interface implemetationPrivate method IConnection.PrepareRequest

Top

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