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

后端 未结 4 828
我在风中等你
我在风中等你 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:27

    For the sake of completeness, one should notice that whether it was about networking, files, time / dates or any other part of the ANSI C / POSIX APIs, MICROSOFT has spent a great deal of energy to make sure that its proprietary generations of Windows APIs are incompatible with the Unix APIs (that existed far before Windows).

    The same strategy is used by MICROSOFT with HTML (IE), HTTP (IIS), OpenDocuments (MS-Word), etc. so the usual excuse that it is accidental (or only motivated by the desire to 'innovate') is more than doubtful.

    Look at how much C# is a (bad) copy of Java - while at the same time managing to be completely incompatible (the function names are very close if not identical, but the number of parameters -or their order- is different).

    Now you know why you had to ask this question in the first place.

提交回复
热议问题