OLClientSocket Class Reference
[Sockets]

A socket that can initiate a connection with a server. More...

#import <ObjectiveLib/Socket.h>

Inheritance diagram for OLClientSocket:

Inheritance graph
[legend]
List of all members.

Public Member Functions

(void) - connectToAddress:
 Connect to a server.
Initializers and Deallocators
(id) - init
 Initialize the socket.
(id) - initWithRemoteAddress:
 Initialize the socket.
(id) - initWithRemoteAddress:localAddress:
 Initialize the socket.

Detailed Description

A socket that can initiate a connection with a server.

A client typically obtains the address of a server and connects to it by calling connectToAddress: (OLClientSocket). After a successful connection is made the client may use its streams to communicate with the server.

A client may bind to a local address, but it is not strictly necessary. A local address will be automatically assigned to the client when a connection is made if the client does not already have a local address.

See also:
OLServerSocket


Member Function Documentation

- (void) connectToAddress: (OLSocketAddress *)  address  

Connect to a server.

The server at address is contacted to establish a connection.

Exceptions:
OLSocketException if the connection cannot be made
Parameters:
address the address of the server to which to connect

- (id) init  

Initialize the socket.

Exceptions:
OLSocketException if the socket cannot be initialized
Returns:
a reference to this socket

- (id) initWithRemoteAddress: (OLSocketAddress *)  remote  

Initialize the socket.

The socket is immediately connected to the address remote.

Exceptions:
OLSocketException if the socket cannot be initialized
Parameters:
remote the server to which this client should connect
Returns:
a reference to this socket

- (id) initWithRemoteAddress: (OLSocketAddress *)  remote
localAddress: (OLSocketAddress *)  local 

Initialize the socket.

The socket is immediately bound to the address local, connected to the address remote.

Exceptions:
OLSocketException if the socket cannot be initialized
Parameters:
remote the server to which this client should connect
local the address to which this socket should be bound
Returns:
a reference to this socket


The documentation for this class was generated from the following file:
ObjectiveLibGenerated Sun Apr 22 15:18:22 2007, © 2004-2007 Will Mason
SourceForge.net Logo