--- deliantra/server/ext/tcp.ext 2006/12/23 03:38:43 1.5 +++ deliantra/server/ext/tcp.ext 2008/05/05 09:01:58 1.10 @@ -10,16 +10,16 @@ our $LISTEN = new IO::Socket::INET LocalPort => cf::settings->csport, Listen => 1, - Blocking => 0, # bugfix workaround for Event calling handler twice :( + Blocking => 0, ReuseAddr => 1; if (!$LISTEN) { # extension yes, completely stupid, not yet - warn "unable to establish listen sockect, exiting.\n"; + warn "unable to establish listen socket, exiting.\n"; exit (2); } -Event->io (fd => $LISTEN, nice => 1, poll => 'r', data => cf::WF_AUTOCANCEL, cb => sub { +our $LISTENER = EV::io $LISTEN, EV::READ, sub { my ($fh, $peername) = $LISTEN->accept or return; @@ -28,5 +28,13 @@ warn "new connection from $host\n"; + # HACK to avoid blocking on common files on log-in. + # remove once async + cf::async {#d# + warn "HACK: $cf::CONFDIR/$_", Coro::AIO::aio_load "$cf::CONFDIR/$_", my $dummy for qw(rules news motd);#d# + warn "HACK: $cf::VARDIR/crossfiremail", Coro::AIO::aio_load "$cf::VARDIR/crossfiremail", my $dummy;#d# cf::client::create $fd, $host; -}); + undef $fh;#d# + };#d#d +}; +