eval '*EWOULDBLOCK = *EAGAIN = sub { 10035 };' unless defined *EWOULDBLOCK;
eval '*F_GETFL = sub { 0 };' unless defined *F_GETFL;
eval '*F_SETFL = sub { 0 };' unless defined *F_SETFL;
- eval 'sub IPPROTO_TCP { 6 };' unless defined *IPPROTO_TCP;
- eval 'sub TCP_NODELAY { 1 };' unless defined *TCP_NODELAY;
+ eval 'sub IPPROTO_TCP { 6 };';
+ eval 'sub TCP_NODELAY { 1 };';
$blocking_supported = 0; # it appears that this DOESN'T work :-(
}
}
}
}
+sub ax25
+{
+ my $conn = shift;
+ return $conn->{csort} eq 'ax25';
+}
+
+sub peerhost
+{
+ my $conn = shift;
+ $conn->{peerhost} ||= 'ax25' if $conn->ax25;
+ $conn->{peerhost} ||= $conn->{sock}->peerhost if $conn->{sock} && $conn->{sock}->isa('IO::Socket::INET');
+ $conn->{peerhost} ||= 'UNKNOWN';
+ return $conn->{peerhost};
+}
+
#-----------------------------------------------------------------
# Send side routines
sub connect {
return undef unless $r || _err_will_block($!);
$conn->{sock} = $sock;
-
+ $conn->{peerhost} = $sock->peerhost; # for consistency
+
if ($conn->{rproc}) {
my $callback = sub {$conn->_rcv};
set_event_handler ($sock, read => $callback);