30Mar01=======================================================================
1. fix errors on accept in ExtMsg and in Msg
+2. fix the non-blocking problems of connects (and other things in general).
29Mar01=======================================================================
1. add better tracking of AGW circuits (possibly)
2. add set and unset/agwmonitor (ing) [for all the notice it seems to take]
if ($sock) {
my $conn = $server_conn->new($server_conn->{rproc});
$conn->{sock} = $sock;
+ Msg::blocking($sock, 0);
+ $conn->{blocking} = 0;
my ($rproc, $eproc) = &{$server_conn->{rproc}} ($conn, $conn->{peerhost} = $sock->peerhost(), $conn->{peerport} = $sock->peerport());
if ($eproc) {
use DXDebug;
use Timer;
-use vars qw(%rd_callbacks %wt_callbacks %er_callbacks $rd_handles $wt_handles $er_handles $now %conns $noconns);
+use vars qw(%rd_callbacks %wt_callbacks %er_callbacks $rd_handles $wt_handles $er_handles $now %conns $noconns $blocking_supported);
%rd_callbacks = ();
%wt_callbacks = ();
$er_handles = IO::Select->new();
$now = time;
-my $blocking_supported = 0;
BEGIN {
# Checks if blocking is supported
eval {
- require POSIX; POSIX->import(qw (F_SETFL F_GETFL O_NONBLOCK));
+ require POSIX; POSIX->import(qw(O_NONBLOCK F_SETFL F_GETFL))
};
- $blocking_supported = 1 unless $@;
+ if ($@) {
+ print STDERR "POSIX Blocking *** NOT *** supported $@\n";
+ } else {
+ $blocking_supported = 1;
+ print STDERR "POSIX Blocking enabled\n";
+ }
+
# import as many of these errno values as are available
eval {
my $proto = getprotobyname('tcp');
$sock->socket(AF_INET, SOCK_STREAM, $proto) or return undef;
- if ($conn->{blocking}) {
- blocking($sock, 0);
- $conn->{blocking} = 0;
- }
+ blocking($sock, 0);
+ $conn->{blocking} = 0;
my $ip = gethostbyname($to_host);
# my $r = $sock->connect($to_port, $ip);
if ($sock) {
my $conn = $server_conn->new($server_conn->{rproc});
$conn->{sock} = $sock;
+ blocking($sock, 0);
+ $conn->{blocking} = 0;
my ($rproc, $eproc) = &{$server_conn->{rproc}} ($conn, $conn->{peerhost} = $sock->peerhost(), $conn->{peerport} = $sock->peerport());
$conn->{sort} = 'Incoming';
if ($eproc) {