Which socket protocol types support blocking read? stream? dgram? raw?
Posted: Wed Nov 15, 2017 8:28 pm
sockets.h defines 3 socket protocol types: SOCK_STREAM, SOCK_DGRAM and SOCK_RAW.
Do any of these support blocking reads?
I am using the lwip_socket(..) function to create the socket and lwip_read(..) or lwip_recv(..) to do the reads.
Underneath both read functions ultimately call: lwip_recvfrom(..).
I see that lwip_recv(..) allows for some flags to be passed in while the lwip_read(..) does not. Are there specific flags to enable blocking read?
Is there a way to specify you want blocking reads when configuring the socket/connection?
Is there some way to achieve the blocking read via the lwip_setsockopt(..) function?
I am specifically using SOCK_STREAM in specific tests and can't get the read() to block. I am interested all 3 socket protocol types as mentioned previously.
I have looked at the sockets.h/sockets.c code but it's not obvious what the default behaviors are and how to achieve the blocking read semantic.
Do any of these support blocking reads?
I am using the lwip_socket(..) function to create the socket and lwip_read(..) or lwip_recv(..) to do the reads.
Underneath both read functions ultimately call: lwip_recvfrom(..).
I see that lwip_recv(..) allows for some flags to be passed in while the lwip_read(..) does not. Are there specific flags to enable blocking read?
Is there a way to specify you want blocking reads when configuring the socket/connection?
Is there some way to achieve the blocking read via the lwip_setsockopt(..) function?
I am specifically using SOCK_STREAM in specific tests and can't get the read() to block. I am interested all 3 socket protocol types as mentioned previously.
I have looked at the sockets.h/sockets.c code but it's not obvious what the default behaviors are and how to achieve the blocking read semantic.