in reply to Re: Creating a server that accepts more than one client.
in thread Creating a server that accepts more than one client.

Building on this, there are two kinds of servers for multiple clients: 1) multiple simultaneous clients and, 2) multpile sequential clients. Looking at your code, it appears that you have a server (at least trying to be) of the second type. The "while(accept)fork" model as explained by VSarkiss is for multiple simultaneous clients.

The Net::Server module looks very interesting. I'd never seen or heard of it before, but may go that way in the future, if it is possible. Unfortunately such modules are not always compatible with other modules (e.g. Gtk becuase it does not use Gtk's event model), so you sometimes have to write your own.

HTH, --traveler

  • Comment on Re: Re: Creating a server that accepts more than one client.