Sockets - Using INADDR_ANY on client side

前端 未结 4 1800
长情又很酷
长情又很酷 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:31

    It seems like your question is not really about "client-side", but about bind vs connect.

    INADDR_ANY can be sensibly used with bind on both client and server. Using it with connect() is pointless and should cause a connection failure.

提交回复
热议问题