|
|
A socket used used to transport data for a Jabber stream
| JBSocket (JBEngine* engine, JBStream* stream,
const char* address, int port)
| JBSocket |
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 |
| inline ~JBSocket ()
| ~JBSocket |
Destructor. Close the socket
| inline bool valid ()
| valid |
[const]
Check if the socket is valid
Returns: True if the socket is valid.
| inline const SocketAddr& addr ()
| addr |
[const]
Get the remote peer's address
Returns: The remote peer's address
| inline const String& error ()
| error |
[const]
Get last connect/send/receive error text
Returns: Last error text
| bool connect (bool& terminated, const char* newAddr, int newPort = 0)
| connect |
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
| void terminate (bool shutdown = false)
| terminate |
Terminate the socket
Parameters:
| shutdown | True to shut down, false to asynchronously terminate the socket |
| bool recv (char* buffer, unsigned int& len)
| recv |
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)
| send |
Write data to socket
Parameters:
| buffer | Source buffer |
| len | The number of bytes to send |
Returns: False on socket error
| Generated by: paulc on bussard on Mon Mar 8 12:18:15 2010, using kdoc 2.0a54. |