@ISA = qw(IO::Handle);
-$VERSION = "1.29";
+$VERSION = "1.29_01";
@EXPORT_OK = qw(sockatmark);
$err ? undef : $sock;
}
+sub close {
+ @_ == 1 or croak 'usage: $sock->close()';
+ my $sock = shift;
+ ${*$sock}{'io_socket_peername'} = undef;
+ $sock->SUPER::close();
+}
+
sub bind {
@_ == 2 or croak 'usage: $sock->bind(NAME)';
my $sock = shift;
sub peername {
@_ == 1 or croak 'usage: $sock->peername()';
my($sock) = @_;
- getpeername($sock)
- || ${*$sock}{'io_socket_peername'}
- || undef;
+ ${*$sock}{'io_socket_peername'} ||= getpeername($sock);
}
sub connected {
sub shutdown {
@_ == 2 or croak 'usage: $sock->shutdown(HOW)';
my($sock, $how) = @_;
+ ${*$sock}{'io_socket_peername'} = undef;
shutdown($sock, $how);
}
use Errno;
@ISA = qw(IO::Socket);
-$VERSION = "1.29";
+$VERSION = "1.29_01";
my $EINVAL = exists(&Errno::EINVAL) ? Errno::EINVAL() : 1;
local($!);
my $title = ref($sock).": ";
$@ = join("", $_[0] =~ /^$title/ ? "" : $title, @_);
- close($sock)
+ $sock->close()
if(defined fileno($sock));
}
$! = $err;