better way of usage

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I'm trying to build a server aimed to be a 'bridge' between internal clients
and external servers (a kind of proxy server). So for each incoming
client's connection server creates another socket connected to external
server and then transfers data between those two sockets. Server allows up
to 300 simultaneously connected clients.
I'm quite lazy so I'm trying to play with willing to avoid
dispatching IO events by myself. So the question is: what is the better way
to use :

a). create new pair of watchers each time when incoming connection detected
b). keep 600 watchers (300 for client socks and 300 for external socks) and
modify watcher's 'fd' attribute (using $watcher->fd method) 'on-the-fly' ?

Thanks a lot for advance.

Site Timeline