Winsock - Technology

Technology

The Windows Sockets API specification defines two interfaces: the API used by application developers, and the SPI, which provides a means for network software developers to add new protocol modules to the system. Each interface represents a contract. The API guarantees that a conforming application will function correctly with a conforming protocol implementation from any network software vendor. The SPI contract guarantees that a conforming protocol module may be added to Windows and will thereby be usable by an API-compliant application. Although these contracts were important when Windows Sockets was first released, since network environments required multi-protocol support (see above) they are now of only academic interest. Included in the Windows Sockets API version 2.0 are functions to use IPX/SPX, but no commercial application is known to exist which utilises this transport, since the protocol was all but obsolete already at the time WSA 2.0 shipped. Microsoft has shipped the TCP/IP protocol stack with all recent versions of Windows, and there are no significant independent alternatives. Nor has there been significant interest in implementing protocols other than TCP/IP.

Windows Sockets code and design are based on BSD sockets, but provides additional functionality to allow the API to comply with the regular Windows programming model. The Windows Sockets API covered almost all the features of the BSD sockets API, but there were some unavoidable obstacles which mostly arose out of fundamental differences between Windows and Unix (though to be fair Windows Sockets differed less from BSD sockets than the latter did from STREAMS). All function calls in the API begin with the moniker WSA, e.g. WSASend for sending data on a connected socket.

However it was a design goal of Windows Sockets that it should be relatively easy for developers to port socket-based applications from Unix to Windows. It was not considered sufficient to create an API which was only useful for newly-written Windows programs. For this reason, Windows Sockets included a number of elements which were designed to facilitate porting. For example, Unix applications were able to use the same errno variable to record both networking errors and errors detected within standard C library functions. Since this was not possible in Windows, Windows Sockets introduced a dedicated function, WSAGetLastError, to retrieve error information. Such mechanisms were helpful, but application porting remained extremely complex. Many original TCP/IP applications had been implemented by using system features specific to Unix, such as pseudo terminals and the fork system call, and reproducing such functionality in Windows was problematic. Within a relatively short time, porting gave way to the development of dedicated Windows applications.

Read more about this topic:  Winsock

Famous quotes containing the word technology:

    Radio put technology into storytelling and made it sick. TV killed it. Then you were locked into somebody else’s sighting of that story. You no longer had the benefit of making that picture for yourself, using your imagination. Storytelling brings back that humanness that we have lost with TV. You talk to children and they don’t hear you. They are television addicts. Mamas bring them home from the hospital and drag them up in front of the set and the great stare-out begins.
    Jackie Torrence (b. 1944)

    Primitive peoples tried to annul death by portraying the human body—we do it by finding substitutes for the human body. Technology instead of mysticism!
    Max Frisch (1911–1991)