#include <socket_decl.hxx>
List of all members.
Public Member Functions |
| StreamSocket (oslAddrFamily Family=osl_Socket_FamilyInet, oslProtocol Protocol=osl_Socket_ProtocolIp, oslSocketType Type=osl_Socket_TypeStream) |
| Creates a socket.
|
| StreamSocket (const StreamSocket &) |
| StreamSocket (oslSocket Socket, __sal_NoAcquire noacquire) |
| StreamSocket (oslSocket Socket) |
sal_Int32 | read (void *pBuffer, sal_uInt32 n) |
| Retrieves n bytes from the stream and copies them into pBuffer.
|
sal_Int32 | write (const void *pBuffer, sal_uInt32 n) |
| Writes n bytes from pBuffer to the stream.
|
sal_Int32 | recv (void *pBuffer, sal_uInt32 BytesToRead, oslSocketMsgFlag flags=osl_Socket_MsgNormal) |
| Tries to receive BytesToRead data from the connected socket,.
|
sal_Int32 | send (const void *pBuffer, sal_uInt32 BytesToSend, oslSocketMsgFlag=osl_Socket_MsgNormal) |
| Tries to send BytesToSend data to the connected socket.
|
Constructor & Destructor Documentation
Creates a socket.
- Parameters:
-
Type | For some protocols it might be desirable to use a different type than osl_Socket_TypeStream (like osl_Socket_TypeSeqPacket ). Therefore this parameter is not hidden. |
osl::StreamSocket::StreamSocket |
( |
const StreamSocket & |
socket | ) |
[inline] |
osl::StreamSocket::StreamSocket |
( |
oslSocket |
Socket | ) |
[inline] |
Member Function Documentation
sal_Int32 osl::StreamSocket::read |
( |
void * |
pBuffer, |
|
|
sal_uInt32 |
n |
|
) |
| [inline] |
Retrieves n bytes from the stream and copies them into pBuffer.
The method avoids incomplete reads due to packet boundaries and is thus blocking.
- Parameters:
-
pBuffer | receives the read data. pBuffer must be large enough to hold n bytes. |
n | the number of bytes to read. |
- Returns:
- the number of read bytes. The number will only be smaller than n if an exceptional condition (e.g. connection closed) occurs.
sal_Int32 osl::StreamSocket::recv |
( |
void * |
pBuffer, |
|
|
sal_uInt32 |
BytesToRead, |
|
|
oslSocketMsgFlag |
flags = osl_Socket_MsgNormal |
|
) |
| [inline] |
Tries to receive BytesToRead data from the connected socket,.
- Parameters:
-
[out] | pBuffer | Points to a buffer that will be filled with the received data. pBuffer must have at least have a size of BytesToRead. |
[in] | BytesToRead | The number of bytes to read. |
[in] | flags | Modifier for the call. Valid values are: |
-
osl_Socket_MsgNormal
-
osl_Socket_MsgOOB
-
osl_Socket_MsgPeek
-
osl_Socket_MsgDontRoute
-
osl_Socket_MsgMaxIOVLen
- Returns:
- the number of received bytes, which may be less than BytesToRead.
sal_Int32 osl::StreamSocket::send |
( |
const void * |
pBuffer, |
|
|
sal_uInt32 |
BytesToSend, |
|
|
oslSocketMsgFlag |
Flag = osl_Socket_MsgNormal |
|
) |
| [inline] |
Tries to send BytesToSend data to the connected socket.
- Parameters:
-
pBuffer | [in] Points to a buffer that contains the send-data. |
BytesToSend | [in] The number of bytes to send. pBuffer must have at least this size. |
Flag | [in] Modifier for the call. Valid values are:
-
osl_Socket_MsgNormal
-
osl_Socket_MsgOOB
-
osl_Socket_MsgPeek
-
osl_Socket_MsgDontRoute
-
osl_Socket_MsgMaxIOVLen
|
- Returns:
- the number of transfered bytes. It may be less than BytesToSend.
sal_Int32 osl::StreamSocket::write |
( |
const void * |
pBuffer, |
|
|
sal_uInt32 |
n |
|
) |
| [inline] |
Writes n bytes from pBuffer to the stream.
The method avoids incomplete writes due to packet boundaries and is thus blocking.
- Parameters:
-
pBuffer | contains the data to be written. |
n | the number of bytes to write. |
- Returns:
- the number of written bytes. The number will only be smaller than n if an exceptional condition (e.g. connection closed) occurs.
The documentation for this class was generated from the following files: