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.7 by root, Tue Mar 6 21:19:10 2007 UTC vs.
Revision 1.8 by root, Wed Nov 14 08:09:46 2007 UTC

17 # extension yes, completely stupid, not yet 17 # extension yes, completely stupid, not yet
18 warn "unable to establish listen socket, exiting.\n"; 18 warn "unable to establish listen socket, exiting.\n";
19 exit (2); 19 exit (2);
20} 20}
21 21
22Event->io ( 22our $LISTENER = EV::io $LISTEN, EV::READ, sub {
23 reentrant => 0,
24 fd => $LISTEN,
25 nice => 1,
26 poll => 'r',
27 data => cf::WF_AUTOCANCEL,
28 cb => sub {
29 my ($fh, $peername) = $LISTEN->accept 23 my ($fh, $peername) = $LISTEN->accept
30 or return; 24 or return;
31 25
32 my $fd = fileno $fh; 26 my $fd = fileno $fh;
33 my $host = inet_ntoa +(sockaddr_in $peername)[1]; 27 my $host = inet_ntoa +(sockaddr_in $peername)[1];
34 28
35 warn "new connection from $host\n"; 29 warn "new connection from $host\n";
36 30
37 cf::client::create $fd, $host; 31 cf::client::create $fd, $host;
38 }, 32};
39);
40 33

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines