|
|
A class for dealing with sockets.
|
Constructs a ppsocket
|
Copy constructor
~ |
[virtual]
Destructor
bool |
[virtual]
Connects to a given host.
Parameters:
Peer | The Host to connect to (name or dotquad-string). |
PeerPort | The port to connect to. |
Host | The local address to bind to. |
HostPort | The local port to bind to. |
Returns: true on success, false otherwise.
bool |
[virtual]
Reopens the connection after closing it.
Returns: true on success, false otherwise.
std::string |
[virtual]
Retrieve a string representation of the ppsocket.
Returns: a string in the form "<host>:<hostport> -> <peer>:<peerport>" where elements not known, are replaced by "???" and none-existing elements are represented by the word "none".
bool |
[virtual]
Starts listening.
Parameters:
Host | The local address to bind to. |
Port | The local port to listen on. |
Returns: true on success, false otherwise.
ppsocket * |
Accept a connection.
Parameters:
Peer | If non-Null, the peer's name is returned here. |
Returns: A pointer to a new instance for the accepted connection or NULL if an error happened.
bool |
[const]
Check and optionally wait for incoming data.
Parameters:
sec | Timeout in seconds |
usec | Timeout in microseconds |
Returns: true if data is available, false otherwise.
int |
Receive data into a bufferStore .
Parameters:
a | The bufferStore to fill with received data. |
wait | If true, wait until something is received, else return if no data is available. |
Returns: 1 if a bufferStore received, 0, if no bufferStore received, -1 on error.
bool |
Sends data from a bufferStore .
Parameters:
a | The bufferStore to send. |
Returns: true on success, false otherwise.
bool |
Closes the connection.
Returns: true on success, false otherwise.
bool |
Binds to a local address and port.
Parameters:
Host | The local address to bind to. |
Port | The local port to listen on. |
Returns: true on success, false otherwise.
bool |
Tries repeated binds to a local address and port.
If Retries
is <= High
- Low,
then
the port to bind is randomly chosen in the given range.
Otherwise, all ports starting from High
up to Low
are tried in sequence.
Parameters:
Host | The local address to bind to. |
Low | The lowest local port to listen on. |
High | The highest local port to listen on. |
Retries | The number of retries until giving up. |
Returns: true on success, false otherwise.
bool |
Sets the linger parameter of the socket.
Parameters:
LingerOn | true, if lingering should be on. |
LingerTime | If lingering is on, the linger-time. |
Returns: true on success, false otherwise.
bool |
Retrieves peer information.
Parameters:
Peer | The peers name is returned here. |
Port | The peers port is returned here. |
Returns: true on success, false otherwise.
bool |
Retrieves local information.
Parameters:
Host | The local name is returned here. |
Port | The local port is returned here. |
Returns: true on success, false otherwise.
void |
Registers an IOWatch for this socket. This IOWatch gets the socket added/removed automatically.
Parameters:
watch | The IOWatch to register. |
Generated by: felfert@usw-pr-shell1.sourceforge.net on Sat Aug 10 18:46:04 2002, using kdoc 2.0a36. |