Sunday, June 9, 2013

Phase 9 - Implement Multi-Client

What to do
1) Implement multiple clients connect to server.
There are several ways to implement a server serving multiple client concurrently. Two common approaches are to use fork() and select()
The fork() approach
The select() approach

I ended up using the fork() approach, which is really easy. The basic idea is whenever the server accepts a client connection, it creates a new process to deal with this connection. Thus different clients can perform its own operation without affecting each other. As soon as the clients exits, the corresponding process terminates itself.

Goal
Modify the server program so that it could handle multiple clients at the same time. Run client program on different machines and connects to the same server.

No comments:

Post a Comment