--- deliantra/server/ext/tcp.ext 2006/12/23 03:38:43 1.5 +++ deliantra/server/ext/tcp.ext 2007/01/21 21:28:27 1.6 @@ -19,14 +19,22 @@ exit (2); } -Event->io (fd => $LISTEN, nice => 1, poll => 'r', data => cf::WF_AUTOCANCEL, cb => sub { - my ($fh, $peername) = $LISTEN->accept - or return; +Event->io ( + reentrant => 0, + fd => $LISTEN, + nice => 1, + poll => 'r', + data => cf::WF_AUTOCANCEL, + cb => 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; -});