ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/tcp.ext
(Generate patch)

Comparing deliantra/server/ext/tcp.ext (file contents):
Revision 1.5 by root, Sat Dec 23 03:38:43 2006 UTC vs.
Revision 1.8 by root, Wed Nov 14 08:09:46 2007 UTC

13 Blocking => 0, # bugfix workaround for Event calling handler twice :( 13 Blocking => 0, # bugfix workaround for Event calling handler twice :(
14 ReuseAddr => 1; 14 ReuseAddr => 1;
15 15
16if (!$LISTEN) { 16if (!$LISTEN) {
17 # extension yes, completely stupid, not yet 17 # extension yes, completely stupid, not yet
18 warn "unable to establish listen sockect, exiting.\n"; 18 warn "unable to establish listen socket, exiting.\n";
19 exit (2); 19 exit (2);
20} 20}
21 21
22Event->io (fd => $LISTEN, nice => 1, poll => 'r', data => cf::WF_AUTOCANCEL, cb => sub { 22our $LISTENER = EV::io $LISTEN, EV::READ, sub {
23 my ($fh, $peername) = $LISTEN->accept 23 my ($fh, $peername) = $LISTEN->accept
24 or return; 24 or return;
25 25
26 my $fd = fileno $fh; 26 my $fd = fileno $fh;
27 my $host = inet_ntoa +(sockaddr_in $peername)[1]; 27 my $host = inet_ntoa +(sockaddr_in $peername)[1];
28 28
29 warn "new connection from $host\n"; 29 warn "new connection from $host\n";
30 30
31 cf::client::create $fd, $host; 31 cf::client::create $fd, $host;
32}); 32};
33

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines