Is it always required to bind a socket?

前端 未结 2 820
我寻月下人不归
我寻月下人不归 2021-02-06 03:02

Well, my question may look like a basic stuff, but i am new to network programming side. I wish to know:

1) Is it always required to bind a socket in order to receive me

2条回答
  •  孤城傲影
    2021-02-06 03:42

    I don't know about Linux, but on Windows, if recvfrom() is called on an unbound socket, it will fail with an WSAEINVAL error.

提交回复
热议问题