Search code examples
socketsnetwork-programminglan

How are sockets used for connections/streaming between application NOT over a network?


I have heard that sockets are used for all sorts of streaming between applications to send and receive data.

I have always thought and even read from articles that aim to give a "general sense" that sockets are used to create connections over networks.

However recently I saw that sockets are also used for local streaming/connections between apps which are not over a network.

My question;

  • How are sockets used for connections/streaming NOT over a network between apps?

Solution

  • If the applications are on the same machine then you can use the localhost or loopback address 127.0.0.1 as the IP address of the socket and any port number > 1024 in both applications and then they can communicate over this connection .