Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcStreamSocket Class Reference

RFCOMM socket holds connection creation to other bt socket. More...

Inheritance diagram for XFcStreamSocket:

[legend]
Collaboration diagram for XFcStreamSocket:

[legend]
List of all members.

## Public Member Functions
XFCIMPORT INT | open (const XFcAddress &aAddress, XFcAsyncCallBack *aCallBack=NULL)
| Opens connection to destination address.
XFCIMPORT INT | open (XFcSocket &aSocket, XFcAsyncCallBack *aCallBack=NULL)
| Listens connection from other device.
XFCIMPORT INT | bind (XFcAddress &aAddress)
| Binds the socket if used as server.
XFCIMPORT INT | listen (INT aListen)
| Sets up a socket to listen for incoming connections.
XFCIMPORT INT | send (const CHAR8 *aData, INT aLen, XFcAsyncCallBack *aCallBack)
| Sends data, socket ready messages are signaled througth aCallBack.
XFCIMPORT INT | recv (XFcAsyncCallBack *aCallBack)
| Receives data, uses callback for receiving data.
XFCIMPORT INT | recv (CHAR8 *aData, INT32 aLen, INT aFlags)
| Receives data from socket, not supported if socket is in listen mode.
XFCIMPORT INT | send (const CHAR8 *aData, INT32 aLen, INT aFlags)
| Sends data to socket, not supported if socket is in listen mode.
virtual XFCIMPORT | ~XFcStreamSocket ()
| Virtual destructor.
## Static Public Member Functions
XFCIMPORT XFcStreamSocket * | create (INT aPlank=0)
| Creates RFCOMM Socket.
## Protected Member Functions
| XFcStreamSocket ()
| Protected constructor.
INT | init (INT aPlank)
| Initializes XFcL2CAPSocket.

## Detailed Description

RFCOMM socket holds connection creation to other bt socket.

One is able to create RFCOMM server socket or client socket. If socket is changed to asynchronous, XFcAsyncCallBack interface pointer must be given. Default socket is created to blocking mode.

## Constructor & Destructor Documentation

XFcStreamSocket::XFcStreamSocket | ( |  | ) | `[protected]`

| Protected constructor.

virtual XFCIMPORT XFcStreamSocket::~XFcStreamSocket | ( |  | ) | `[virtual]`

| Virtual destructor.

## Member Function Documentation

XFCIMPORT INT XFcStreamSocket::bind | ( | XFcAddress & | aAddress | ) |

  | Binds the socket if used as server. Parameters:
  aAddress | address where to bind (only port is needed).
Returns: 0 if successful, or -1 if unsuccessful.

XFCIMPORT XFcStreamSocket* XFcStreamSocket::create | ( | INT | aPlank = 0 | ) | `[static]`

| Creates RFCOMM Socket. Returns: new XFcStreamSocket object if successful, or NULL if unsuccessful.

INT XFcStreamSocket::init | ( | INT | aPlank | ) | `[protected]`

| Initializes XFcL2CAPSocket. Returns: 1 if success else 0

XFCIMPORT INT XFcStreamSocket::listen | ( | INT | aListen | ) |

  | Sets up a socket to listen for incoming connections. Creates backbuffer for incoming connection. Parameters:
  aListen | is backbuffer size
Returns: 0 if successful, or -1 if unsuccessful.

XFCIMPORT INT XFcStreamSocket::open | ( | XFcSocket & | aSocket,
|  | XFcAsyncCallBack * | aCallBack = NULL
| ) |

  | Listens connection from other device. Parameters:
  aSocket | listen socket.
  aCallBack | callback object.
Returns: 0 if successful, or -1 if unsuccessful.

XFCIMPORT INT XFcStreamSocket::open | ( | const XFcAddress & | aAddress,
|  | XFcAsyncCallBack * | aCallBack = NULL
| ) |

  | Opens connection to destination address. Parameters:
  aAddress | address where to connect.
  aCallBack | callback object.
Returns: 0 if successful, or -1 if unsuccesful.

XFCIMPORT INT XFcStreamSocket::recv | ( | CHAR8 * | aData,
|  | INT32 | aLen,
|  | INT | aFlags
| ) |

  | Receives data from socket, not supported if socket is in listen mode. Parameters:
  aData | buffer for the incoming data.
  aLen | length of buffer.
  aFlags | read flags.
Returns: length of read data if successful, or -1 if unsuccessful.

XFCIMPORT INT XFcStreamSocket::recv | ( | XFcAsyncCallBack * | aCallBack | ) |

  | Receives data, uses callback for receiving data. Parameters:
  aCallBack | is callback interface for received data.
Returns: 0 if successful, or -1 if unsuccessful.

XFCIMPORT INT XFcStreamSocket::send | ( | const CHAR8 * | aData,
|  | INT32 | aLen,
|  | INT | aFlags
| ) |

  | Sends data to socket, not supported if socket is in listen mode. Parameters:
  aData | buffer for outgoing data.
  aLen | length of buffer.
  aFlags | send flags.
Returns: length of sent data if successful, or -1 if unsuccessful.

XFCIMPORT INT XFcStreamSocket::send | ( | const CHAR8 * | aData,
|  | INT | aLen,
|  | XFcAsyncCallBack * | aCallBack
| ) |

  | Sends data, socket ready messages are signaled througth aCallBack. Parameters:
  aData | is pointer to data buffer.
  aLen | is data buffer length in bytes.
  aCallBack | is signaling interface.
Returns: 0 if successful, or -1 if unsuccessful. 0 does not mean that data is delivered successfully.

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch