Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Answer: How can my tcp client call a sub directory when calling a socket connection?

by scottknight (Novice)
on Nov 27, 2004 at 20:23 UTC ( #410741=categorized answer: print w/replies, xml ) Need Help??

Q&A > HTTP and FTP clients > How can my tcp client call a sub directory when calling a socket connection? - Answer contributed by scottknight

This seems to work for me (though I am having bad luck with a D-Link modem at the moment):
my $sock = IO::Socket::INET->new( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Timeout => 5 ); unless ($sock) { $errormessage = $tr{'could not connect to http://$host:$port/$filen +ame'}; return '0'; } $sock->print("GET /".$filename." HTTP/1.0\r\n");

  • Comment on Answer: How can my tcp client call a sub directory when calling a socket connection?
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2016-12-03 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (55 votes). Check out past polls.