Why are there WSA pendants for socket(), connect(), send() and so on, but not for closesocket()?

后端 未结 4 766
我在风中等你
我在风中等你 2021-02-05 16:08

I\'m going to try to explain what I mean using a few examples:

  • socket() -> WSASocket()
  • connect() -> WSAConnect()
  • send() -> WSASend()
  • sen
4条回答
  •  醉话见心
    2021-02-05 16:36

    closesocket is only available on Windows, I'm not sure why they didn't follow the WSA convention there though. If it really bothers you though you can make your own wrapper that calls closesocket.

    As mentioned in WSASocket a call to closesocket should be made.

提交回复
热议问题