in reply to Re^4: Single user to multi user socket server
in thread Single user to multi user socket server

Thanks for all your help. I have tried the Proxy method. But I guess I should have explained this part better. The data that the server is connecting to is streaming out every second none stop. The client only needs to receive the data no publish back to the server. I got the blow code to work for a browser, but it hangs on a telnet session unless you hit a key stroke.. Then it comes screaming across. The data that is coming out does not have a \n or \r or ETX or STX.. it is just there.. I have the code to package and build it. then ship it to the client.. But.. it is getting it to the client that is a pain in code..
#!/usr/local/bin/perl -w use strict; use IO::Socket; use IO::Select; # create a socket to listen to a port my $listen = IO::Socket::INET->new(Proto => 'tcp', LocalPort => 2323, Listen => 1, Reuse => 1) or die $!; my $sk = IO::Socket::INET->new('PeerAddr' => '192.168.3.100', 'PeerPor +t' =>'4004', 'Proto'=>'tcp') || die "Can't connect"; # to start with, $select contains only the socket we're listening on my $select = IO::Select->new($listen); my @ready; # wait until there's something to do while(1) { if(@ready = $select->can_read(0)){ my $socket; # handle each socket that's ready for $socket (@ready) { # if the listening socket is ready, accept a new connection if($socket == $listen) { my $new = $listen->accept; $select->add($new); print $new->fileno . ": connected\n"; } else { # otherwise, read a line of text and send it back again my $line; my $lineB; $sk->recv($line, 1024); $socket->recv($lineB,1); $lineB=length($lineB); print "length ",length($lineB),"\n"; print "Ord ",ord($lineB),"\n"; print "Revc ",$lineB,"\n"; if($lineB > 0){ print "Hello\n"; $socket->send($line); } } } } }