Hi everyone,

It's my first day studying sockets.  I'm having
trouble getting the script on my server to initialize
itself because I don't have a shell account for my
website.  Can I initialize the Socket on the server
side from a cgi script on my machine?

Here's my code.

#!/usr/bin/perl
BEGIN{open(STDERR,">>./errsocket.txt");}
use CGI header;
print header;
use IO::Socket;
$sock = new IO::Socket::INET (
       LocalHost => 'www.websiteprogrammin.com',
       LocalPort => 1200,
       Proto     => 'tcp',
       Listen    => 5,
       Reuse     => 1                             
       );
print "Socket could not be created. 
       Reason: $!" unless $sock;
open (FILE, ">$file") || 
 print "\nCouldn't open $file to write socket
input.$!";
while ($new_sock = $sock->accept()) {
    while (defined ($buf = <$new_sock>)) {
       print FILE $buf;
    }
}
close ($sock);
close (FILE);


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to