Winsock or Windows Sockets is a Windows - programming interface (API) for accessing computer networks via sockets .
Winsock supplements Windows with the Internet protocol family and is responsible for connecting the PC to the Internet . It is used by programs to access the network through the Internet Protocol (IP). To do this, the program calls certain functions in the winsock.dll library (or wsock32.dll from Windows 95 / NT).
If a program (for example a web browser ) wants to communicate via the network (for example contacts a web server ), it forwards the request to Winsock, which then tries to establish the connection. Winsock reports back to the calling program as to whether the connection was successful or not. If a connection has been established, further Winsock function calls can be used to exchange data over the network (e.g. loading Internet pages).
By using the Winsock API , it is in principle possible to write IP-using programs that are source code compatible between Windows and POSIX operating systems. Since Winsock 2.0, other protocols than those of the Internet protocol family are also possible, such as: B. IPX .
Winsock was developed by Microsoft in 1992 . For this purpose, practically all functions were taken over by the Unix and BSD operating systems . Previously, you had to rely on third-party implementations, such as B. the common shareware by Peter Tattam.