Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

void UDPSocket::sendTo ( const void *  buffer,
int  bufferLen,
const string &  foreignAddress,
unsigned short  foreignPort 
) throw (SocketException)

Send the given buffer as a UDP datagram to the specified address/port.

Parameters:
buffer buffer to be written
bufferLen number of bytes to write
foreignAddress address (IP address or name) to send to
foreignPort port number to send to
Returns:
true if send is successful
Exceptions:
SocketException thrown if unable to send datagram

Definition at line 327 of file PracticalSocket.cpp.

References fillAddr(), and Socket::sockDesc.

00329                            {
00330   sockaddr_in destAddr;
00331   fillAddr(foreignAddress, foreignPort, destAddr);
00332 
00333   // Write out the whole buffer as a single message.
00334   if (sendto(sockDesc, (raw_type *) buffer, bufferLen, 0,
00335              (sockaddr *) &destAddr, sizeof(destAddr)) != bufferLen) {
00336     throw SocketException("Send failed (sendto())", true);
00337   }
00338 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:13:09 2011 for ImpalaSrc by  doxygen 1.5.1