UDK 3.2.7 C/C++ API Reference
Public Member Functions
osl::DatagramSocket Class Reference

A connectionless socket to send and receive datagrams. More...

#include <socket_decl.hxx>

Inheritance diagram for osl::DatagramSocket:
osl::Socket

List of all members.

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.

Detailed Description

A connectionless socket to send and receive datagrams.


Constructor & Destructor Documentation

osl::DatagramSocket::DatagramSocket ( oslAddrFamily  Family = osl_Socket_FamilyInet,
oslProtocol  Protocol = osl_Socket_ProtocolIp,
oslSocketType  Type = osl_Socket_TypeDgram 
) [inline]

Creates a datagram socket.

Parameters:
Typeis sock_dgram by default.

Member Function Documentation

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.

Parameters:
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:
  • osl_Socket_MsgNormal
  • osl_Socket_MsgOOB
  • osl_Socket_MsgPeek
  • osl_Socket_MsgDontRoute
  • osl_Socket_MsgMaxIOVLen
Returns:
the number of received bytes.
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.

Parameters:
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
Returns:
the number of transfered bytes.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines