/[cvs]/joko/TestArea/perl/runtime/POE/net/server_tcp_connect.pl
ViewVC logotype

Annotation of /joko/TestArea/perl/runtime/POE/net/server_tcp_connect.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Sun May 11 21:48:54 2003 UTC (21 years, 4 months ago) by joko
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
initial commit

1 joko 1.1 sub POE::Kernel::ASSERT_DEFAULT () { 1 }
2     sub POE::Kernel::TRACE_DEFAULT () { 1 }
3    
4     use POE qw(Component::Server::TCP);
5    
6     $bind_port = 8000;
7     $bind_address = '127.0.0.1';
8    
9     # First form just accepts connections.
10    
11     POE::Component::Server::TCP->new
12     ( Port => $bind_port,
13     Address => $bind_address, # Optional.
14     Acceptor => \&accept_handler,
15     Error => \&error_handler, # Optional.
16     );
17    
18    
19    
20     sub accept_handler {
21     my ($socket, $remote_address, $remote_port) = @_[ARG0, ARG1, ARG2];
22     print "accept", "\n";
23     }
24    
25     sub error_handler {
26     my ($syscall_name, $error_number, $error_string) = @_[ARG0, ARG1, ARG2];
27     print "error", "\n";
28     }
29    
30     $poe_kernel->run();
31    

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed