Back to Listening on a Port

Interprocess Communication (IPC) · Listening on a Port · Practice Question

Start a Server and Client Process on Different Ports

Sign in to track your progress

Question

Start two separate q processes — one acting as a server, the other as a client. Have the server listen on port 5001, and the client listen on port 5002.

Solution

q -p 5001    # server
q -p 5002    # client

Explanation

Each process opens its own port via -p independently — listening just makes a process reachable. The actual connection comes later, when the client calls hopen against the server's port.

This server/client pair is the setup used throughout the rest of this section.