Ejemplo n.º 1
0
int DatagramSocket::send(const struct sockaddr* dest, const char * message, size_t length )
{
	assert(length<=MAX_UDP_LENGTH);
	int retVal = sendto(mSocketFD, message, length, 0, dest, addressSize());
	if (retVal == -1 ) perror("DatagramSocket::send() failed");
	return retVal;
}
Ejemplo n.º 2
0
int DatagramSocket::writeBack( const char * message, size_t length )
{
	//assert(length<=MAX_UDP_LENGTH);	// (pat 8-2013) Removed on David's orders.
	int retVal = sendto(mSocketFD, message, length, 0,
		(struct sockaddr *)mSource, addressSize());
	if (retVal == -1 ) perror("DatagramSocket::write() failed");
	return retVal;
}
Ejemplo n.º 3
0
int DatagramSocket::send(const struct sockaddr* dest, const char * message, size_t length )
{
	// (pat 8-2013) Dont assert!
	// assert(length<=MAX_UDP_LENGTH);
	// sendto is supposed to return an error if the packet is too long.
	int retVal = sendto(mSocketFD, message, length, 0, dest, addressSize());
	if (retVal == -1 ) perror("DatagramSocket::send() failed");
	return retVal;
}