|
|
XGConnection |
| Inherits from: | |
| Declared In: |
An XGConnection object represents the connection between an Xgrid client and an Xgrid controller.
The XGConnection class is created by an Xgrid client using the name or address of a controller. The connection can be in one of four states, and a collection of constants is declared which are used describe which state a connection is in. An authenticator can be set on the connector, which allows the connection to be authenticated. A delegate may be set on the connection, and will receive callbacks when connection events occur, prior to the notification of key-value observers.
Returns the authenticator of the receiver.
Starts closing the connection from the client to the controller.
Returns the delegate of the receiver.
Returns the error of the receiver.
Returns the hostname the receiver was initialized with, or nil if the receiver wasn't initialized with a hostname.
Initializes a XGConnection object with a hostname and portnumber.
Initializes a XGConnection object with a NSNetService.
Returns YES iff the connection state is Closed.
Returns YES iff the connection state is Open.
Returns the name of the connection. This may be the name of the netService or the hostname, depending on which the receiver was initialized with.
Returns the NSNetService the receiver was initialized with, or nil if the receiver wasn't initialized with an NSNetService.
Starts opening the connection from the client to the controller.
Returns the portnumber the receiver was initialized with, or the default portnumber if the receiver was initialized with a 0 portnumber, or 0 if the receiver wasn't initialized with a portnumber.
Sets the authenticator of the receiver.
Sets the delegate of the receiver.
Returns the state of the receiver.
authenticator |
Returns the authenticator of the receiver.
- (XGAuthenticator *)authenticator;
The authenticator of the receiver.
close |
Starts closing the connection from the client to the controller.
- (void)close;
This method may only be called when the connection is in the Opening or Open states.
delegate |
Returns the delegate of the receiver.
- (id)delegate;
The delegate of the receiver.
error |
Returns the error of the receiver.
- (NSError *)error;
The error of the receiver.
The error is nil during the Opening and Closing states. The error represents success if the connection is in the Open state. If the connection closes due to an error, then this will be set to that error. If the connection closes due to a -close message, then this will be a success error.
hostname |
Returns the hostname the receiver was initialized with, or nil if the receiver wasn't initialized with a hostname.
- (NSString *)hostname;
The hostname the receiver connects to.
initWithHostname:portnumber: |
Initializes a XGConnection object with a hostname and portnumber.
hostnameThe hostname to connect to. May be a name or address. Must not be nil.
portnumberThe portnumber to connect to. If portnumber is 0 then the default portnumber will be used.
initWithNetService: |
Initializes a XGConnection object with a NSNetService.
- (id)initWithNetService:(NSNetService *)netService;
netServiceThe net service to connect to. Must not be nil.
An initialized XGConnection object.
isClosed |
Returns YES iff the connection state is Closed.
- (BOOL)isClosed;
isOpened |
Returns YES iff the connection state is Open.
- (BOOL)isOpened;
name |
Returns the name of the connection. This may be the name of the netService or the hostname, depending on which the receiver was initialized with.
- (NSString *)name;
The name of the receiver.
netService |
Returns the NSNetService the receiver was initialized with, or nil if the receiver wasn't initialized with an NSNetService.
- (NSNetService *)netService;
The NSNetService the receiver connects to.
open |
Starts opening the connection from the client to the controller.
- (void)open;
This method may only be called when the connection is in the Closed state.
portnumber |
Returns the portnumber the receiver was initialized with, or the default portnumber if the receiver was initialized with a 0 portnumber, or 0 if the receiver wasn't initialized with a portnumber.
- (UInt32)portnumber;
The portnumber the receiver connects to.
setAuthenticator: |
Sets the authenticator of the receiver.
- (void)setAuthenticator:(XGAuthenticator *)authenticator;
The authenticator is retained. The authenticator will be used by the connection if the client or controller requires the connection to be authenticated.
setDelegate: |
Sets the delegate of the receiver.
delegateThe delegate.
The delegate is not retained. If the delegate implements any of the methods in the XGConnectionDelegate protocol then it will receive callbacks when connection events occur, prior to the notification of key-value observers.
state |
Returns the state of the receiver.
- (XGConnectionState)state;
The state of the receiver.
Last Updated: 2009-08-12