This code will give you a functional server you can telnet into. Don't use it for anything but testing:
#!/usr/bin/perl -w use strict; use IO::Socket; my $sock = IO::Socket::INET->new( Listen => 1, LocalAddr => 'localhost', LocalPort => 9000, ) || die "Unable to create socket: $!\n"; print "Waiting for message...\n"; while ( my $fh = $sock->accept()) { print while <$fh>; } close ($sock);
cheers
tachyon
In reply to Re^3: Trouble with sockets
by tachyon
in thread Trouble with sockets
by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |