I wrote simple program to handle incoming UDP packets. I send 60000 UDP packets to and this programm is losing packets. Bandwith about 60-70 Mbit/s. If I wun tcpdump in parallel, then I see that all packages are received by the kernel. Also I tried recvmsg and recvmmsg with same result. Program source code: Answer The problem was solved. I
Tag: recv
socket recv function not returning updated value
Trying to create socket application using c (Linux) to constantly fetch data from a server For this I have created a loop and inside it the routine connects , send a command, receive some data and close the socket. It works fine for the first interaction but looks like the recv function failing to update the buffer variable from second
Can I be sure that a UDP recv executed immediately after a successfull call to recv with MSG_PEEK will not block?
Assume the following code (for the sake of simplicity I’ve omitted the necessary error handling here): In that case: Can I be sure that after the first call to recv the whole datagram is already received and therefore the second call to to recv will not block? Or can it happen that if IP splits the datagram, the first recv
Linux: Recv randomly returns zero
I wrote a simple TCP network library with epoll for linux. In one of my tests, I want to test the throughput of the library. I send 2000000 msgs of 500 bytes. The binded socket randomly returns zero on a recv after 800000 or more msgs have been received. Other times, all messages are received. What would cause this to