in reply to Single user to multi user socket server

Possibility 1: open 1 rtk_connection per accepted connection. That is, do the follow in the child after the fork:
$rtk_connection= IO::Socket::INET->new('PeerAddr'=>$rtk_ip, 'PeerPort' + =>$rtk_port, 'Reuse'=>1, 'Proto'=>'tcp') || warn "Can not create rtk + socket on IP $rtk_ip and port $rtk_port: $!\n";
Of course, whether you can do that depends on what application you're connecting to on port 4004.

Possibility 2: Instead of forking, use select to be able to read from any open socket. See IO::Select for a sketchy example.

Replies are listed 'Best First'.
Re: Re: Single user to multi user socket server
by Anonymous Monk on Jun 02, 2004 at 00:26 UTC
    You are correct in your first thought. I have an application using the the reverse method working fine. But I am connection to a source that allows only one connection. I tried the IO::Select idea. but it seems to block on every client but the one.. am I just missing something or just totally lost. I am trying to get this to work on a Win2K platform. any help would be great. Just enough so i can get my information to all the clients at the same time. I am slowly running out of hair on this.. and so is everyone else