PDA

View Full Version : Adding FDs to readfds in a SELECT statement


minesh
05-05-2003, 09:29 PM
I have a server that uses the SELECT statement to receive connections and send data on those FDs. Clients using the CONNECT statement usually connect to the server. If I have two servers in a system, can I have one server, which has its own client connections, CONNECT to a port on the other server and then add that socket FD to the readfds? Then I can sit on a server and listen to the FDs in readfds from clients and servers.

I basically have three servers, A, B and C. Where A talks to B and C, but B and C cannot talk to each other. And A has clients connections.

Thanks and Regards,

Minesh

RobSeace
05-06-2003, 01:53 PM
So, you want one server to be a client of another server? Sure,
no reason why not... You'll just need some way of recognizing
that particular FD, and differentiating it from the FDs belonging
to its own clients' connections... (Presuming they need to be
treated differently, anyway...)