- Inherits from:
- Object
- Declared in:
- DTCPClient.h
Object
|
+---DTCPClient
Class Description
The DTCPClient class implements a number of methods for using a TCP client.
- Last modified:
- 31-Oct-2007 (DTCPClient.h)
Instance Variables
- private DSocket *_local
- the local socket
- private int _sendFlag
- the send flags (def. 0)
- private int _recvFlag
- the receive flags (def. 0)
- private BOOL _connected
- is there a connection to the server ?
- Constructors
- - (DTCPClient *) init
- Initialise the TCP Client
- Returns:
- the object
- - (DTCPClient *) init :(int) family :(int) protocol
- Initialise the TCP Client for a family and protocol
- Parameters:
- family - the family (DSA_AF_INET, DSA_AF_UNIX, DSA_AF_INET6)
protocol - the protocol to be used
- Returns:
- the object
- Deconstructor
- - free
- Free the TCP client object
- Returns:
- the object
- Copy related methods
- - shallowCopy
- Do a shallow copy of the object (not implemented)
- Returns:
- the object
- Member methods
- - (BOOL) isConnected
- Check if there is a connection to the server
- Returns:
- is there a connection ?
- - (int) recvFlag
- Return the receive flag
- Returns:
- the receive flag
- - (DTCPClient *) recvFlag :(int) flag
- Set the receive flag
- Parameters:
- flag - the receive flag
- Returns:
- the object
- - (int) sendFlag
- Return the send flag
- Returns:
- the send flag
- - (DTCPClient *) sendFlag :(int) flag
- Set the send flag
- Parameters:
- flag - the send flag
- Returns:
- the object
- - (DSocket *) socket
- Return the local socket
- Returns:
- a reference to the socket object
- Main methods
- - (DData *) doRequest :(const unsigned char *) request :(unsigned) length :(unsigned) respLength
- Send a request to the server and wait for the response (using send-
and recvFlag)
- Parameters:
- request - the request to be sent
length - the length of the request
respLength - the (maximum) length of the response
- Returns:
- a (new) data object with the response (or nil for error)
- - (BOOL) open :(int) family :(int) protocol
- Open the TCP client
- Parameters:
- family - the family (DSA_AF_INET, DSA_AF_UNIX, DSA_AF_INET6)
protocol - the protocol to be used
- Returns:
- success
- - (BOOL) start :(id <DSocketAddressable>) address
- Start the communication with the server (blocking till connection)
- Parameters:
- address - the address of the server
- Returns:
- success
- - (void) stop
- Stop the communication with the server
- Returns:
- none
generated 05-Nov-2007 by ObjcDoc 3.0.0