UDK 3.2.7 C/C++ API Reference
|
A connectionless socket to send and receive datagrams. More...
#include <socket_decl.hxx>
Public Member Functions | |
DatagramSocket (oslAddrFamily Family=osl_Socket_FamilyInet, oslProtocol Protocol=osl_Socket_ProtocolIp, oslSocketType Type=osl_Socket_TypeDgram) | |
Creates a datagram socket. | |
sal_Int32 | recvFrom (void *pBuffer, sal_uInt32 BufferSize, SocketAddr *pSenderAddr=0, oslSocketMsgFlag Flag=osl_Socket_MsgNormal) |
Tries to receives BufferSize data from the socket, if no error occurs. | |
sal_Int32 | sendTo (const SocketAddr &ReceiverAddr, const void *pBuffer, sal_uInt32 BufferSize, oslSocketMsgFlag Flag=osl_Socket_MsgNormal) |
Tries to send one datagram with BytesToSend size to the given ReceiverAddr. |
A connectionless socket to send and receive datagrams.
osl::DatagramSocket::DatagramSocket | ( | oslAddrFamily | Family = osl_Socket_FamilyInet , |
oslProtocol | Protocol = osl_Socket_ProtocolIp , |
||
oslSocketType | Type = osl_Socket_TypeDgram |
||
) | [inline] |
Creates a datagram socket.
Type | is sock_dgram by default. |
sal_Int32 osl::DatagramSocket::recvFrom | ( | void * | pBuffer, |
sal_uInt32 | BufferSize, | ||
SocketAddr * | pSenderAddr = 0 , |
||
oslSocketMsgFlag | Flag = osl_Socket_MsgNormal |
||
) | [inline] |
Tries to receives BufferSize data from the socket, if no error occurs.
pSenderAddr | [out] You must provide pointer to a SocketAddr. It will be filled with the address of the datagrams sender. If pSenderAddr is 0, it is ignored. |
pBuffer | [out] Points to a buffer that will be filled with the received datagram. |
BufferSize | [in] The size of pBuffer. |
Flag | [in] Modifier for the call. Valid values are:
|
sal_Int32 osl::DatagramSocket::sendTo | ( | const SocketAddr & | ReceiverAddr, |
const void * | pBuffer, | ||
sal_uInt32 | BufferSize, | ||
oslSocketMsgFlag | Flag = osl_Socket_MsgNormal |
||
) | [inline] |
Tries to send one datagram with BytesToSend size to the given ReceiverAddr.
Since there is only send one packet, the function doesn't care about packet boundaries.
ReceiverAddr | [in] A SocketAddr that contains the destination address for this send. |
pBuffer | [in] Points to a buffer that contains the send-data. |
BufferSize | [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