c - How to set timeout in recvmmsg()? -


i build simple application using c used recvmmsg(), , fifth parameter passed timeout of type struct timespec. set timeout 5 seconds, it's not working, gets blocking infinity.

the code following:

struct timespec timeout;  timeout.tv_sec =  5; timeout.tv_nsec = 0;  result = recvmmsg(fd, datagrams, batch_size, 0, &timeout); 

as alternative, use setsockopt so_rcvtimeo option set timeout on socket. affect read operations performed on it.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -