- Inherits from:
- Object
- Declared in:
- DUDPServer.h
Object
|
+---DUDPServer
Class Description
The DUDPServer class implements a number of methods for implementing a UDP server.
(Note: this class assumes that the socket is blocking)
- Last modified:
- 31-Oct-2007 (DUDPServer.h)
Instance Variables
- private DSocket *_local
- the local socket
- private int _sendFlag
- the send flag (def. 0)
- private int _recvFlag
- the receive flag (def. 0)
- private unsigned _recvLength
- the length used during receiving of requests (def. 1024)
- private id <DSocketAddressable> _peer
- the peer address
- Constructors
- - (DUDPServer *) init
- Initialise the UDP Server
- Returns:
- the object
- - (DUDPServer *) init :(int) family :(int) protocol
- Initialise the UDP Server 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
- Copy related methods
- - shallowCopy
- Do a shallow copy of the object (not implemented)
- Returns:
- the object
- Deconstructor
- - free
- Free the UDP server object
- Returns:
- the object
- Member methods
- - (int) recvFlag
- Return the receive flag
- Returns:
- the receive flag
- - (DUDPServer *) recvFlag :(int) flag
- Set the receive flag
- Parameters:
- flag - the receive flag
- Returns:
- the object
- - (unsigned) recvLength
- Return the length for receiving of requests
- Returns:
- the length
- - (DUDPServer *) recvLength :(unsigned) length
- Set the length for receiving of requests
- Parameters:
- length - the length
- Returns:
- the object
- - (int) sendFlag
- Return the send flag
- Returns:
- the send flag
- - (DUDPServer *) sendFlag :(int) flag
- Set the send flag
- Parameters:
- flag - the send flag
- Returns:
- the object
- - (DSocket *) socket
- Return the local socket for the UDP server
- Returns:
- a reference to the local socket
- Main methods
- - (BOOL) handleRequest :(DData *) request :(DData *) response
- Handle a new request by the client (called by handleRequests, to be overridden)
- Parameters:
- request - the request made by the client
respone - the destination for the response
- Returns:
- should the server be stopped ?
- - (BOOL) open :(int) family :(int) protocol
- Open the UDP server
- 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 handling of requests (blocking, loop until error or stop request)
- Returns:
- the object
generated 05-Nov-2007 by ObjcDoc 3.0.0