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:
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
You will need to add threading capabilities if you want more than one connection from multiple clients to the server.