SRHubConnection Class Reference
| Inherits from | SRConnection : NSObject |
| Declared in | SRHubConnection.h |
Overview
An SRHubConnection object provides an abstraction over SRConnection and provides support for publishing and subscribing to custom events
Tasks
Properties
-
hubsThe
propertyNSMutableDictionaryobject containing theSRHubProxyobjects -
+ connectionWithURL:A convenience method for initWithURL:(NSString *)url;
-
– initWithURL:Initializes a new
SRHubConnectionobject at the specified URL -
– createProxy:Creates a client side proxy to the hub on the server side.
-
– start:Starts the connection for all hubs
-
– stopStops the connection for all hubs
Properties
hubs
The NSMutableDictionary object containing the SRHubProxy objects
@property (strong, nonatomic, readonly) NSMutableDictionary *hubsDeclared In
SRHubConnection.hClass Methods
connectionWithURL:
A convenience method for initWithURL:(NSString *)url;
+ (SRHubConnection *)connectionWithURL:(NSString *)URLParameters
- URL
the endpoint to initialize the new connection to
Return Value
an SRHubConnection object
Discussion
SRHubConnection *connection = [SRHubConnection connectionWithURL:@“http://mysite/”]http://mysite/“];
Important: This url will not point to a specific handler. But will instead point to the root of your site.
Declared In
SRHubConnection.hInstance Methods
createProxy:
Creates a client side proxy to the hub on the server side.
- (SRHubProxy *)createProxy:(NSString *)hubNameParameters
- hubName
hubName the name of the hub
Return Value
SRHubProxy object
Discussion
SRHubProxy *myHub = [connection createProxy:@“MySite.MyHub”];
Important: The name of this hub needs to be the full type name of the hub.
Declared In
SRHubConnection.hinitWithURL:
Initializes a new SRHubConnection object at the specified URL
- (id)initWithURL:(NSString *)urlParameters
- url
the endpoint to initialize the new connection to
Return Value
an SRHubConnection object
Discussion
SRHubConnection *connection = [[SRHubConnection alloc] initWithURL:@“http://mysite/”];
Important: This url will not point to a specific handler. But will instead point to the root of your site.
Declared In
SRHubConnection.hstart:
Starts the connection for all hubs
- (void)start:(id<SRClientTransport>)transportParameters
- transport
the transport to use for the connection
Declared In
SRHubConnection.h