BLIPConnection Class Reference

#import <BLIPConnection.h>

Inherits TCPConnection.

List of all members.


Detailed Description

Represents a connection to a peer, using the BLIP protocol over a TCP socket.

Outgoing connections are made simply by instantiating a BLIPConnection via -initToAddress:. Incoming connections are usually set up by a BLIPListener and passed to the listener's delegate. Most of the API is inherited from TCPConnection.

Public Member Functions

(BLIPRequest *) - request
 Creates a new, empty outgoing request.
(BLIPRequest *) - requestWithBody:properties:
 Creates a new outgoing request.
(BLIPResponse *) - sendRequest:
 Sends a request over this connection.

Properties

assign id< BLIPConnectionDelegatedelegate
 The delegate object that will be called when the connection opens, closes or receives messages.
readonly BLIPDispatcherdispatcher
 The connection's request dispatcher.


Member Function Documentation

- (BLIPRequest *) request  

Creates a new, empty outgoing request.

You should add properties and/or body data to the request, before sending it by calling its -send method.

- (BLIPRequest *) requestWithBody: (NSData*)  body
properties: (NSDictionary*)  properies 

Creates a new outgoing request.

The body or properties may be nil; you can add additional data or properties by calling methods on the request itself, before sending it by calling its -send method.

- (BLIPResponse *) sendRequest: (BLIPRequest*)  request  

Sends a request over this connection.

(Actually, it queues it to be sent; this method always returns immediately.) Call this instead of calling -send on the request itself, if the request was created with +[BLIPRequest requestWithBody:] and hasn't yet been assigned to any connection. This method will assign it to this connection before sending it. The request's matching response object will be returned, or nil if the request couldn't be sent.


Property Documentation

- (id< BLIPConnectionDelegate >) delegate [protected]

The delegate object that will be called when the connection opens, closes or receives messages.

Reimplemented from TCPConnection.

- (BLIPDispatcher *) dispatcher [protected]

The connection's request dispatcher.

By default it's not configured to do anything; but you can add rules to the dispatcher to call specific target methods based on properties of the incoming requests.

Requests that aren't handled by the dispatcher (i.e. all of them, by default) will be passed to the delegate's connection:receivedRequest: method; or if there's no delegate, a generic error response will be returned.


The documentation for this class was generated from the following files:
Generated on Tue May 27 22:56:33 2008 for MYNetwork:MooseyardNetworking by  doxygen 1.5.4