CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Socket problem

 



Qlubbie
New User

Aug 27, 2008, 1:49 AM

Post #1 of 1 (410 views)
Socket problem Can't Post

Hey everyone,

Im having trouble reading the response from a socket.
here's a bit of code:

Code
my $sock=IO::Socket::INET->new(PeerAddr=>'url', PeerPort=>port, Proto=>'tcp') 

$sock->print($message);
$sock->flush;

while (!($sock->eof)) {
$line.=$sock->getline();
print sprintf("%s\n", $line);
sleep(1);
}


The message is an xml string and it gives a response, but the problem is, it enters the while and never goes past the getline(); untill the socket times out, or is colsed.

The message comes back ok, but i want to keep the socket open to send another xml string (depending on the response of the first)

anyone know what i could do about this?

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives