ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent/Socket.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent/Socket.pm (file contents):
Revision 1.23 by root, Sun May 25 03:14:20 2008 UTC vs.
Revision 1.24 by root, Sun May 25 03:44:03 2008 UTC

466address and port number of the local socket endpoint as second and third 466address and port number of the local socket endpoint as second and third
467arguments. 467arguments.
468 468
469It should return the length of the listen queue (or C<0> for the default). 469It should return the length of the listen queue (or C<0> for the default).
470 470
471Example: bind on TCP port 8888 on the local machine and tell each client 471Example: bind on some TCP port on the local machine and tell each client
472to go away. 472to go away.
473 473
474 tcp_server undef, 8888, sub { 474 tcp_server undef, undef, sub {
475 my ($fh, $host, $port) = @_; 475 my ($fh, $host, $port) = @_;
476 476
477 syswrite $fh, "The internet is full, $host:$port. Go away!\015\012"; 477 syswrite $fh, "The internet is full, $host:$port. Go away!\015\012";
478 }, sub {
479 my ($fh, $thishost, $thisport) = @_;
480 warn "bound to $thishost, port $thisport\n";
478 }; 481 };
479 482
480=cut 483=cut
481 484
482sub tcp_server($$$;$) { 485sub tcp_server($$$;$) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines