JBSocket Class Reference
A Jabber streams's socket.
More...
#include <yatejabber.h>
List of all members.
Detailed Description
A Jabber streams's socket.
A socket used used to transport data for a Jabber stream
Constructor & Destructor Documentation
Constructor. Build socket for an outgoing stream
- Parameters:
-
| engine | The Jabber engine |
| stream | The stream owning this socket |
| address | The address used to connect to |
| port | Port used to connect to remote server |
Destructor. Close the socket
Member Function Documentation
Get the remote peer's address
- Returns:
- The remote peer's address
bool connect |
( |
bool & |
terminated, |
|
|
const char * |
newAddr, |
|
|
int |
newPort = 0 | |
|
) |
| | |
Connect the socket
- Parameters:
-
| terminated | True if false is returned and the socket was terminated while connecting |
| newAddr | Optional address to connect to |
| newPort | Optional port to connect to |
- Returns:
- False on failure
const String& error |
( |
|
) |
const [inline] |
Get last connect/send/receive error text
- Returns:
- Last error text
bool recv |
( |
char * |
buffer, |
|
|
unsigned int & |
len | |
|
) |
| | |
Read data from socket
- Parameters:
-
| buffer | Destination buffer |
| len | The number of bytes to read. On exit contains the number of bytes actually read |
- Returns:
- False on socket error
bool send |
( |
const char * |
buffer, |
|
|
unsigned int & |
len | |
|
) |
| | |
Write data to socket
- Parameters:
-
| buffer | Source buffer |
| len | The number of bytes to send |
- Returns:
- False on socket error
void terminate |
( |
bool |
shutdown = false |
) |
|
Terminate the socket
- Parameters:
-
| shutdown | True to shut down, false to asynchronously terminate the socket |
bool valid |
( |
|
) |
const [inline] |
Check if the socket is valid
- Returns:
- True if the socket is valid.
The documentation for this class was generated from the following file: