in reply to Socket output issue...
#!/usr/bin/perl -w use strict; use IO::Socket; my ($host, $port, $handle, $byte); unless (@ARGV == 2) { die "usage: $0 host port" } ($host, $port) = @ARGV; $handle = IO::Socket::INET->new(Proto => "tcp", PeerAddr => $host, PeerPort => $port); unless ($handle) { die "cannot connect to mail server on $host" } $handle->autoflush(1); print "[Connected to $host:$port]\n"; print $handle "ETRN mydomain.com\nQUIT\n"; while ( <$handle> ) { print } close $handle;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: Socket output issue...
by zentara (Cardinal) on Sep 04, 2002 at 16:18 UTC |