Skip to content

Tag: udp

recv() skipping UDP packets

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: A…

How to get values for ipi_ifindex for sendmsg()?

Using sendmsg() it is possible to specify from which interface a datagram will be sent, if a value is set for in_pktinfo.ipi_ifindex. If the packet is a response to a datagram received with recvmsg() I can get the interface value from there. If I just know that the interface if ‘eth0’ or ‘en…

2 program get same udp packets from a port

there is a server will send some UDP packets to my localhost, for example: if it send some UDP packets to my localhost and destination port is 5000. and there will have a client program to receive it on port 5000. but, what I want is to create another program, it will try to receive the same packets on port

Combining sento() write writev()?

I’ve set a udp socket and call sendto() with a different recipient at each call. I would like to use writev() in order to benefit scater/gather io but writev() does not allows me to specify the recipient addr/port as in sendto(). Any suggestions? Answer You can use writev to send a coalesced set of buff…