Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: IO::Socket, Multiple GET.

by jhourcle (Prior)
on Jul 02, 2009 at 14:26 UTC ( [id://776760]=note: print w/replies, xml ) Need Help??


in reply to IO::Socket, Multiple GET.

$msg = "GET /engine3.php?req_sale=5205&page=1\r\n";

You're sending HTTP/0.9, which doesn't have provisions for persistent connections, and the server will always disconnect you. You need to either send an HTTP/1.1 request, or HTTP/1.0 with the appropriate headers ... and for that, I'd do as poolpi and our anonymous friend have already mentioned, and use LWP::UserAgent (search the instructions for 'keep_alive' ).

Replies are listed 'Best First'.
Re^2: IO::Socket, Multiple GET.
by ikegami (Patriarch) on Jul 02, 2009 at 16:58 UTC

    You need to either send an HTTP/1.1 request, or HTTP/1.0 with the appropriate headers

    • HTTP/1.1 does not automatically keep the connection open. An appropriate Keep-Alive header must be sent.

    • Keep-Alive was introduced in HTTP/1.1. HTTP/1.0 does not support keeping the connection open.

      However, since Keep-Alive is compatible with HTTP/1.0, many servers that claim to be HTTP/1.0 support Keep-Alive. This was the cases even when HTTP/1.1 was still a draft.

    • Finally, servers are under no requirement to honour Keep-Alive requests.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://776760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-03-28 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found