--- deliantra/server/ext/tcp.ext 2007/03/06 21:19:10 1.7 +++ deliantra/server/ext/tcp.ext 2007/11/14 08:09:46 1.8 @@ -19,22 +19,15 @@ exit (2); } -Event->io ( - reentrant => 0, - fd => $LISTEN, - nice => 1, - poll => 'r', - data => cf::WF_AUTOCANCEL, - cb => sub { - my ($fh, $peername) = $LISTEN->accept - or return; +our $LISTENER = EV::io $LISTEN, EV::READ, sub { + my ($fh, $peername) = $LISTEN->accept + or return; - my $fd = fileno $fh; - my $host = inet_ntoa +(sockaddr_in $peername)[1]; + my $fd = fileno $fh; + my $host = inet_ntoa +(sockaddr_in $peername)[1]; - warn "new connection from $host\n"; + warn "new connection from $host\n"; - cf::client::create $fd, $host; - }, -); + cf::client::create $fd, $host; +};