(incubating) | The Free and Open Productivity Suite

Developer's Guide

API

SDK

Tips 'n' Tricks

Miscellaneous

Content for OpenOffice.org version 3.3.

Methods of Class DatagramSocket


DatagramSocket
DatagramSocket(
oslAddrFamily Family = osl_Socket_FamilyInet,
oslProtocol Protocol = osl_Socket_ProtocolIp,
oslSocketType Type = osl_Socket_TypeDgram );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Creates a datagram socket.
Parameters
Type
is sock_dgram by default.

recvFrom
sal_Int32 recvFrom(
void * pBuffer,
sal_uInt32 BufferSize,
SocketAddr * pSenderAddr = 0,
oslSocketMsgFlag Flag = osl_Socket_MsgNormal );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Tries to receives BufferSize data from the socket, if no error occurs.
Parameters
pSenderAddr
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
Points to a buffer that will be filled with the received 
datagram.
BufferSize
The size of pBuffer.
Flag
Modifier for the call. Valid values are:
  • osl_Socket_MsgNormal
  • osl_Socket_MsgOOB
  • osl_Socket_MsgPeek
  • osl_Socket_MsgDontRoute
  • osl_Socket_MsgMaxIOVLen
Return
the number of received bytes.

sendTo
sal_Int32 sendTo(
const SocketAddr & ReceiverAddr,
const void * pBuffer,
sal_uInt32 BufferSize,
oslSocketMsgFlag Flag = osl_Socket_MsgNormal );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Description
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
A SocketAddr that contains
the destination address for this send. 

pBuffer
Points to a buffer that contains the send-data.
BufferSize
The number of bytes to send. pBuffer must have at least
this size.
Flag
Modifier for the call. Valid values are:

  • osl_Socket_MsgNormal
  • osl_Socket_MsgOOB
  • osl_Socket_MsgPeek
  • osl_Socket_MsgDontRoute
  • osl_Socket_MsgMaxIOVLen
Return
the number of transfered bytes.

Top of Page

Apache OpenOffice is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Copyright & License
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.