Main Page   Modules   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

OsclTCPSocket Class Reference
[OSCL IO]

#include <oscl_socket.h>

Inheritance diagram for OsclTCPSocket:

HeapBase _OsclHeapBase

Public Methods

OSCL_IMPORT_REF ~OsclTCPSocket ()
OSCL_IMPORT_REF int32 Close ()
OSCL_IMPORT_REF int32 Bind (OsclNetworkAddress &aAddress)
OSCL_IMPORT_REF TPVSocketEvent BindAsync (OsclNetworkAddress &aAddress, int32 aTimeoutMsec=(-1))
OSCL_IMPORT_REF void CancelBind ()
OSCL_IMPORT_REF int32 Listen (int32 aQueueSize)
OSCL_IMPORT_REF TPVSocketEvent ListenAsync (int32 aQueueSize, int32 aTimeoutMsec=(-1))
OSCL_IMPORT_REF void CancelListen ()
OSCL_IMPORT_REF OsclTCPSocket * GetAcceptedSocketL (uint32 aId)
OSCL_IMPORT_REF uint8 * GetRecvData (int32 *aLength)
OSCL_IMPORT_REF uint8 * GetSendData (int32 *aLength)
OSCL_IMPORT_REF TPVSocketEvent Connect (OsclNetworkAddress &aAddress, int32 aTimeoutMsec=-1)
OSCL_IMPORT_REF void CancelConnect ()
OSCL_IMPORT_REF TPVSocketEvent Shutdown (TPVSocketShutdown aHow, int32 aTimeoutMsec=-1)
OSCL_IMPORT_REF void CancelShutdown ()
OSCL_IMPORT_REF TPVSocketEvent Accept (int32 aTimeout=-1)
OSCL_IMPORT_REF void CancelAccept ()
OSCL_IMPORT_REF TPVSocketEvent Send (const uint8 *aPtr, uint32 aLen, int32 aTimeoutMsec=-1)
OSCL_IMPORT_REF void CancelSend ()
OSCL_IMPORT_REF TPVSocketEvent Recv (uint8 *aPtr, uint32 aMaxLen, int32 aTimeoutMsec=-1)
OSCL_IMPORT_REF void CancelRecv ()

Static Public Methods

OSCL_IMPORT_REF OsclTCPSocket * NewL (Oscl_DefAlloc &alloc, OsclSocketServ &aServ, OsclSocketObserver *aObserver, uint32 aId)

Detailed Description

The TCP Socket class


Constructor & Destructor Documentation

OSCL_IMPORT_REF OsclTCPSocket::~OsclTCPSocket  
 

Destructor. The object must be deleted using the same allocator used in the NewL call.


Member Function Documentation

OSCL_IMPORT_REF TPVSocketEvent OsclTCPSocket::Accept int32    aTimeout = -1
 

Accept incoming connections. This is an asynchronous method.

Parameters:
aTimeoutMsec:  Timeout in milliseconds, or (-1) for infinite wait.
Returns:
Will return EPVSocketPending if successful. When the operation is complete, a callback to the observer will occur with the completion status. If the operation cannot be initiated, the call will return EPVSocketFailure and there will be no callback.

OSCL_IMPORT_REF int32 OsclTCPSocket::Bind OsclNetworkAddress   aAddress
 

Bind a TCP socket to an address. This is a synchronous method.

Parameters:
aAddress:  Bind address.
Returns:
Returns OsclErrNone for success, or a platform-specific error code.

OSCL_IMPORT_REF TPVSocketEvent OsclTCPSocket::BindAsync OsclNetworkAddress   aAddress,
int32    aTimeoutMsec = (-1)
 

Bind a TCP socket to an address. This is an asynchronous method.

Parameters:
aAddress:  Bind address.
aTimeoutMsec:  Optional timeout. Use a negative value for infinite wait.
Returns:
Will return EPVSocketPending if successful. When the operation is complete, a callback to the observer will occur with the completion status. If the operation cannot be initiated, the call will return EPVSocketFailure and there will be no callback.

OSCL_IMPORT_REF void OsclTCPSocket::CancelAccept  
 

Cancel Accept

This method will cancel any pending Accept operation on the current socket, causing the Accept to complete with error EPVSocketCancel. If there is no pending Accept operation, this method will have no effect.

OSCL_IMPORT_REF void OsclTCPSocket::CancelBind  
 

Cancel Bind

This method will cancel any pending BindAsync operation on the current socket, causing the BindAsync to complete with error EPVSocketCancel. If there is no pending BindAsync operation, this method will have no effect.

OSCL_IMPORT_REF void OsclTCPSocket::CancelConnect  
 

Cancel Connect

This method will cancel any pending Connect operation on the current socket, causing the Connect to complete with error EPVSocketCancel. If there is no pending Connect operation, this method will have no effect.

OSCL_IMPORT_REF void OsclTCPSocket::CancelListen  
 

Cancel Async Listen

This method will cancel any pending ListenAsync operation on the current socket, causing the Listen to complete with error EPVSocketCancel. If there is no pending Listen operation, this method will have no effect.

OSCL_IMPORT_REF void OsclTCPSocket::CancelRecv  
 

Cancel Recv

This method will cancel any pending Recv operation on the current socket, causing the Recv to complete with error EPVSocketCancel. If there is no pending Recv operation, this method will have no effect.

OSCL_IMPORT_REF void OsclTCPSocket::CancelSend  
 

Cancel Send

This method will cancel any pending Send operation on the current socket, causing the Send to complete with error EPVSocketCancel. If there is no pending Send operation, this method will have no effect.

OSCL_IMPORT_REF void OsclTCPSocket::CancelShutdown  
 

Cancel Shutdown

This method will cancel any pending Shutdown operation on the current socket, causing the Shutdown to complete with error EPVSocketCancel. If there is no pending Shutdown operation, this method will have no effect.

OSCL_IMPORT_REF int32 OsclTCPSocket::Close  
 

Close a TCP socket. This is a synchronous method.

Once it is closed a socket cannot be re-opened. Sockets are automatically closed when they are deleted. This method may be used to see any error code returned from the platform's socket close call.

Returns:
Returns OsclErrNone for success, or a platform-specific error code.

OSCL_IMPORT_REF TPVSocketEvent OsclTCPSocket::Connect OsclNetworkAddress   aAddress,
int32    aTimeoutMsec = -1
 

Connect to an address. This is an asynchronous method.

Parameters:
aAddress:  a network address.
aTimeoutMsec:  Timeout in milliseconds, or (-1) for infinite wait.
Returns:
Will return EPVSocketPending if successful. When the operation is complete, a callback to the observer will occur with the completion status. If the operation cannot be initiated, the call will return EPVSocketFailure and there will be no callback.

OSCL_IMPORT_REF OsclTCPSocket* OsclTCPSocket::GetAcceptedSocketL uint32    aId
 

Retrieve the accept socket after a successful Accept operation. This is a synchronous method.

Parameters:
aId:  Socket ID. The caller must assign an ID to each socket. The ID is used to identify the socket in observer callbacks.
Returns:
Returns pointer to socket, or NULL if error. Note: The caller is reponsible for deleting any accepted socket that it retrieves.

OSCL_IMPORT_REF uint8* OsclTCPSocket::GetRecvData int32 *    aLength
 

Retrieve the received data after a successful Recv operation. This is a synchronous method.

Parameters:
aLength:  (output) number of bytes of data received.
Returns:
Returns pointer to received data, or NULL if none.

OSCL_IMPORT_REF uint8* OsclTCPSocket::GetSendData int32 *    aLength
 

Retrieve the sent data after a successful Send operation. This is a synchronous method.

Parameters:
aLength:  (output) number of bytes of data sent.
Returns:
Returns pointer to sent data, or NULL if none.

OSCL_IMPORT_REF int32 OsclTCPSocket::Listen int32    aQueueSize
 

Listen. This is a synchronous method.

Parameters:
aQueueSize:  Queue size.
Returns:
Returns OsclErrNone for success, or a platform-specific error code.

OSCL_IMPORT_REF TPVSocketEvent OsclTCPSocket::ListenAsync int32    aQueueSize,
int32    aTimeoutMsec = (-1)
 

ListenAsync This is an asynchronous method.

Parameters:
aQueueSize:  Queue size.
aTimeoutMsec:  Optional timeout. Use a negative value for infinite wait.
Returns:
Will return EPVSocketPending if successful. When the operation is complete, a callback to the observer will occur with the completion status. If the operation cannot be initiated, the call will return EPVSocketFailure and there will be no callback.

OSCL_IMPORT_REF OsclTCPSocket* OsclTCPSocket::NewL Oscl_DefAlloc   alloc,
OsclSocketServ   aServ,
OsclSocketObserver   aObserver,
uint32    aId
[static]
 

Create a TCP Socket. May leave if failure.

Parameters:
alloc:  Memory allocator.
aServ:  Socket server. Must be connected.
aObserver:  Socket observer.
aId:  Socket ID. The caller must assign an ID to each socket. The ID is used to identify the socket in observer callbacks.
Returns:
Returns pointer to socket.

OSCL_IMPORT_REF TPVSocketEvent OsclTCPSocket::Recv uint8 *    aPtr,
uint32    aMaxLen,
int32    aTimeoutMsec = -1
 

Receive Data. This is an asynchronous method.

Parameters:
aPtr:  Buffer for received data.
aMaxLen:  Length of buffer.
aTimeoutMsec:  Timeout in milliseconds, or (-1) for infinite wait.
Returns:
Will return EPVSocketPending if successful. When the operation is complete, a callback to the observer will occur with the completion status. If the operation cannot be initiated, the call will return EPVSocketFailure and there will be no callback.

OSCL_IMPORT_REF TPVSocketEvent OsclTCPSocket::Send const uint8 *    aPtr,
uint32    aLen,
int32    aTimeoutMsec = -1
 

Send Data. This is an asynchronous method.

Parameters:
aPtr:  Data to send.
aLen:  Length of data to send.
aTimeoutMsec:  Timeout in milliseconds, or (-1) for infinite wait.
Returns:
Will return EPVSocketPending if successful. When the operation is complete, a callback to the observer will occur with the completion status. If the operation cannot be initiated, the call will return EPVSocketFailure and there will be no callback.

OSCL_IMPORT_REF TPVSocketEvent OsclTCPSocket::Shutdown TPVSocketShutdown    aHow,
int32    aTimeoutMsec = -1
 

Shutdown a socket. This is an asynchronous method.

Parameters:
aHow:  type of shutdown
aTimeoutMsec:  Timeout in milliseconds, or (-1) for infinite wait.
Returns:
Will return EPVSocketPending if successful. When the operation is complete, a callback to the observer will occur with the completion status. If the operation cannot be initiated, the call will return EPVSocketFailure and there will be no callback.


The documentation for this class was generated from the following file:
OSCL API
Posting Version: OPENCORE_20090310