0

Is WSASendTo() somehow faster than sendto() on Windows?

Is UDP sendto() faster with a non-blocking socket (if there is space in the send buffer)?

Similar to this question :

Faster WinSock sendto()

From my profiling, the send is network bound with blocking socket, i.e. for example with 100 mbit network both send about 38461 datagrams of size 256 bytes/s which is the network speed allowable, I was wondering if anyone has any preference over the 2 speed wise. sending from localhost to itself on 127.0.0.1 it seems to handle about 250 k send / s which should be about 64 mbyte/s on a 3 ghz pc it seems 2 times faster blocking, i.e. without FIONBIO set, i.e. with non blocking set it seems to drop to 32 mbyte/s if I retry on EWOULDBLOCK I don't need to do any heavy duty UDP broadcasting, only wondering the most efficient way if anyone has any deep set "feelings" ? Also could there be some sort of transmission moderation taking place on network card drivers could there be a maximum datagrams sendable on a gigabit card say would it tolerate for example 100k sends/s or moderate somehow ?

user3181125
  • 77
  • 1
  • 8
  • 1
    If you want to know if it is faster, profile your code to time it yourself. – Remy Lebeau Oct 14 '20 at 23:05
  • 2
    both `sendto` and `WSASendTo` after ~same length prolog call [`WSPSendTo`](https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms742291(v=vs.85)). so speed i be say the same. difference in - `WSASendTo` have more options compare `sento` - it allow asynchronous call, when `sendto` only synchronous. how fast single call not depend from how api report call completed - are it wait internal in place or just return control. faster or not - can be your code. how you use api calls – RbMm Oct 14 '20 at 23:07

0 Answers0