Erichailong
V2EX  ›  C

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

  •  
  •   Erichailong · Apr 9, 2021 · 2053 views
    This topic created in 1859 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   ·   Solana   ·   923 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 21:20 · PVG 05:20 · LAX 14:20 · JFK 17:20
    ♥ Do have faith in what you're doing.