You would need to use sockets.
"<i>In computer networking, an Internet socket or network socket is an endpoint of a bidirectional inter-process communication flow across an Internet Protocol-based computer network, such as the Internet</i>."
Read more about sockets on SearchCIO-Midmarket.
In summary, the server application opens a socket and puts it in 'listening' state. Then the client application connects to the server's listening socket, and after that they can start exchanging messages.
Here's an article that should get you started: