Hi ,
Can anyone shed any light on this problem.
The code below should be sending out a UDP datagram with 7 items of data
in it. (len is always 3 for the purpose of this test)
But after the end of my data there are an extra 5 bytes/octets(whatever!)
of stuff that should not be there.... Similar code using another os
(ie linux) and all is ok, is this one of those PalmOS features or me being
dumb!
Any light shed on this would be appreciated...
void send_Data (char * dataToOutput, int len) {
int retval = 0;
int sock, nb;
struct sockaddr addr_me, addr_peer;
unsigned char output[10]; /* */
udp_str_to_addr("1199", (struct sockaddr_in *)&addr_peer);
sock = socket(AF_INET, SOCK_DGRAM, 0);
output[0] = 23; //these for header info for the receiver app
output[1] = 77;
output[2] = 45;
output[3] = 15;
output[4] = dataToOutput[0]; //the data bytes
nb = len + 4; //so for 3 bytes passed to function this will be 7
retval= sendto(sock, output, nb, 0, (struct sockaddr *)&addr_peer,
sizeof(addr_peer));
close (sock);
}
regards
Jon Trinder
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/