Besides system calls, which implements very fundamental OS requests, many OSes also interact with application programs via sockets.
A socket is, essentially, a special file that has no storage associated. When a program “writes” to a socket, the data is not stored. Instead, it is transmitted. A network-based socket transmits the data via the associated TCP/IP connection. However, a socket can also be local so that the data is read by another program or Unix daemon or Windows service.
Some GUIs, such as XWindow (for unix-like environments) use sockets as a means for a GUI engine to communicate with its clients. This method makes little distinction between a GUI program that is running locally and a GUI program that is running remotely. The only difference is that in one case, a socket is listened by a GUI engine directly, whereas in the other case, a socket is “bridged” by a TCP/IP connection.