Erichailong
V2EX  ›  C

Linux C UDP socket 中如何让其立即发包?

  •  
  •   Erichailong · Apr 9, 2021 · 2403 views
    This topic created in 2003 days ago, the information mentioned may be changed or developed.

    想使用UDP发包测试延迟,特别精准的那种,希望每次发包后立即发送,不缓存。

    1 replies  •  2021-04-09 11:06:46 +08:00
    zhengxiaowai
        1
    zhengxiaowai  
       Apr 9, 2021
    Datagrams can be sent immediately using sendto(2)
    or sendmsg(2) with a valid destination address as an argument.

    https://man7.org/linux/man-pages/man7/udp.7.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   851 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:00 · PVG 07:00 · LAX 16:00 · JFK 19:00
    ♥ Do have faith in what you're doing.