By writing a Socket application that listens on the specified port. There a
slew of additional questions that would also arise. For example, what
protocol to support as well as protocol type (TCP, UDP or RAW_Socket). Most
of the time, a listening Socket listens, accepts and authorizes which spawns
a new process to serve the client on yet another Socket port. This allows
the original Socket to keep listening for other clients.
The point is that such Socket to Socket communications usually are
Client-Server based or Producer-Consumer based and therefore involve writing
both a server application and a client application.