Sockets - Using INADDR_ANY on client side

前端 未结 4 1798
长情又很酷
长情又很酷 2020-12-09 13:38

I recently ran into this blog post which describes a TCP server client using libev. The sever uses INADDR_ANY to bind to an interface which is something I\'m fa

4条回答
  •  無奈伤痛
    2020-12-09 14:14

    There is an old BSD convention that connecting to INADDR_ANY means you want to connect to the loopback network. The linux network code explicitly supports this (search for INADDR_ANY in this file). I have no idea what other OSes do or don't support it.

提交回复
热议问题