class JBSocket

A Jabber streams's socket. More...

Full nameTelEngine::JBSocket
Definition#include <libs/yjingle/yatejabber.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

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:
engineThe Jabber engine
streamThe stream owning this socket
addressThe address used to connect to
portPort 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:
terminatedTrue if false is returned and the socket was terminated while connecting
newAddrOptional address to connect to
newPortOptional port to connect to

Returns: False on failure

void  terminate (bool shutdown = false)

terminate

Terminate the socket

Parameters:
shutdownTrue to shut down, false to asynchronously terminate the socket

bool  recv (char* buffer, unsigned int& len)

recv

Read data from socket

Parameters:
bufferDestination buffer
lenThe 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:
bufferSource buffer
lenThe 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.