Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help with a mofication of a perl script that initiates a Socket

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi I have a perl script which opens a socket and allows downloads of files from a firewalled server. But it limits it to one download at a time. A friend said i need to make it open muliple sockets to download multiple files. Please can someone explain how to do this. Thanks. here is the code:<br>#!/usr/bin/perl<br>use Socket;<br>use IO::Handle;<br>open(STDERR, &quot;&gt;&STDOUT&quot;) ¦¦ die &quot;error opening STDOUT&quot;;<br>socket(S, PF_INET, SOCK_STREAM, getprotobyname('tcp')) ¦¦ die &quot;error in socket&quot;;<br>bind(S, sockaddr_in(6699, INADDR_ANY)) ¦¦ die &quot;error in bind&quot;;<br>setsockopt(S, SOL_SOCKET, SO_REUSEADDR, pack(&quot;l&quot;, 1)) ¦¦ die &quot;error in setsockopt&quot;;<br>($port) = unpack_sockaddr_in(getsockname(S));<br>listen(S, SOMAXCONN) ¦¦ die &quot;error in listen&quot;;<br><br>it gives the bind error if trying to do multiple downloads.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top