I have a UDP server implementation , Where i am getting Segmentation fault on recvfrom
call.
#define SIZEOF sizeof
#define PKTSIZE 65535
char tmp_buf[PKTSIZE];
struct sockaddr_storage tmp_from;
int tmp_fromlen = 0;
int tmp_bytes;
tmp_bytes = truncate_size_t_to_int(recvfrom(fd, tmp_buf,
SIZEOF(tmp_buf), 0,
(struct sockaddr *) &tmp_from,
(socklen_t *) &tmp_fromlen));
Both bind and connect was successful before this.It's a single thread process.
What is wrong with this recvfrom
call.
Do I need to do SIGALRM
signal handling for recvfrom
?
truncate_size_t_to_int is for size_t to int.