1POE::Component::Server:U:sTeCrP(C3o)ntributed Perl DocumPeOnEt:a:tCioomnponent::Server::TCP(3)
2
3
4

NAME

6       POE::Component::Server::TCP - a simplified TCP server
7

SYNOPSIS

9         #!perl
10
11         use warnings;
12         use strict;
13
14         use POE qw(Component::Server::TCP);
15
16         POE::Component::Server::TCP->new(
17           Port => 12345,
18           ClientConnected => sub {
19             print "got a connection from $_[HEAP]{remote_ip}\n";
20             $_[HEAP]{client}->put("Smile from the server!");
21           },
22           ClientInput => sub {
23             my $client_input = $_[ARG0];
24             $client_input =~ tr[a-zA-Z][n-za-mN-ZA-M];
25             $_[HEAP]{client}->put($client_input);
26           },
27         );
28
29         POE::Kernel->run;
30         exit;
31

DESCRIPTION

33       POE::Component::Server::TCP implements a generic multi-Session server.
34       Simple services may be put together in a few lines of code.  For
35       example, a server that echoes input back to the client:
36
37         use POE qw(Component::Server::TCP);
38         POE::Component::Server::TCP->new(
39           Port => 12345,
40           ClientInput => sub { $_[HEAP]{client}->put($_[ARG0]) },
41         );
42         POE::Kernel->run();
43
44   Accepting Connections Yourself
45       POE::Component::Server::TCP has a default mode where it accepts new
46       connections and creates the sessions to handle them.  Programs can do
47       this themselves by providing their own "Acceptor" callbacks.  See
48       "Acceptor" for details.
49
50   Master Listener Session
51       At creation time, POE::Component::Server::TCP starts one POE::Session
52       to listen for new connections.  The component's "Alias" refers to this
53       master session.
54
55       If "Acceptor" is specified, then it's up to that callback to deal with
56       newly accepted sockets.  Its parameters are that of
57       POE::Wheel::SocketFactory's "SuccessEvent".
58
59       Otherwise, the default "Acceptor" callback will start a new session to
60       handle each connection.  These child sessions do not have their own
61       aliases, but their "ClientConnected" and "ClientDisconnected" callbacks
62       may be used to register and unregister the sessions with a shared
63       namespace, such as a hash keyed on session IDs, or an object that
64       manages such a hash.
65
66         my %client_namespace;
67
68         sub handle_client_connected {
69           my $client_session_id = $_[SESSION]->ID;
70           $client_namespace{$client_session_id} = \%anything;
71         }
72
73         sub handle_client_disconnected {
74           my $client_session_id = $_[SESSION]->ID;
75           $client_namespace{$client_session_id} = \%anything;
76         }
77
78       The component's "Started" callback is invoked at the end of the master
79       session's start-up routine.  The @_[ARG0..$#_] parameters are set to a
80       copy of the values in the server's "ListenerArgs" constructor
81       parameter.  The other parameters are standard for POE::Session's _start
82       handlers.
83
84       The component's "Error" callback is invoked when the server has a
85       problem listening for connections.  "Error" may also be called if the
86       component's default acceptor has trouble accepting a connection.
87       "Error" receives the usual ones for POE::Wheel::SocketFactory and
88       POE::Wheel::ReadWrite ErrorEvent.
89
90   Default Child Connection Sessions
91       If "Acceptor" isn't specified, POE::Component::Server::TCP's default
92       handler will start a new session for each new client connection.  As
93       mentioned above, these child sessions have no aliases of their own, but
94       they may set aliases or register themselves another way during their
95       "ClientConnected" and "ClientDisconnected" callbacks.
96
97       It can't be stressed enough that the following callbacks are executed
98       within the context of dynamic child sessions---one per client
99       connection---and not in the master listening session.  This has been a
100       major point of confusion.  We welcome suggestions for making this
101       clearer.
102
103       TODO - Document some of the implications of having each connection
104       handled by a separate session.
105
106       The component's "ClientInput" callback defines how child sessions will
107       handle input from their clients.  Its parameters are that of
108       POE::Wheel::ReadWrite's "InputEvent".
109
110       As mentioned "ClientConnected" is called at the end of the child
111       session's "_start" routine.  The "ClientConneted" callback receives the
112       same parameters as the client session's _start does.  The arrayref
113       passed to the constructor's "Args" parameter is flattened and included
114       in "ClientConnected"'s parameters as @_[ARG0..$#_].
115
116         sub handle_client_connected {
117           my @constructor_args = @_[ARG0..$#_];
118           ...
119         }
120
121       "ClientPreConnect" is called before "ClientConnected", and it has
122       different parameters: $_[ARG0] contains a copy of the client socket
123       before it's given to POE::Wheel::ReadWrite for management.  Most HEAP
124       members are set, except of course $_[HEAP]{client}, because the
125       POE::Wheel::ReadWrite has not yet been created yet.  "ClientPreConnect"
126       may enable SSL on the socket, using POE::Component::SSLify.
127       "ClientPreConnect" must return a valid socket to complete the
128       connection; the client will be disconnected if anything else is
129       returned.
130
131         sub handle_client_pre_connect {
132
133           # Make sure the remote address and port are valid.
134           return undef unless validate(
135             $_[HEAP]{remote_ip}, $_[HEAP]{remote_port}
136           );
137
138           # SSLify the socket, which is in $_[ARG0].
139           my $socket = eval { Server_SSLify($_[ARG0]) };
140           return undef if $@;
141
142           # Return the SSL-ified socket.
143           return $socket;
144         }
145
146       "ClientDisconnected" is called when the client has disconnected, either
147       because the remote socket endpoint has closed or the local endpoint has
148       been closed by the server.  This doesn't mean the client's session has
149       ended, but the session most likely will very shortly.
150       "ClientDisconnected" is called from a couple disparate places within
151       the component, so its parameters are neither consistent nor generally
152       useful.
153
154       "ClientError" is called when an error has occurred on the socket.  Its
155       parameters are those of POE::Wheel::ReadWrite's "ErrorEvent".
156
157       "ClientFlushed" is called when all pending output has been flushed to
158       the client socket.  Its parameters come from POE::Wheel::ReadWrite's
159       "ErrorEvent".
160
161   Performance Considerations
162       This ease of use comes at a price: POE::Component::Server::TCP often
163       performs significantly slower than a comparable server written with
164       POE::Wheel::SocketFactory and POE::Wheel::ReadWrite.
165
166       If performance is your primary goal, POE::Kernel's select_read() and
167       select_write() perform about the same as IO::Select, but your code will
168       be portable across every event loop POE supports.
169
170   Special Needs Considerations
171       POE::Component::Server::TCP is written to be easy for the most common
172       use cases.  Programs with more special needs should consider using
173       POE::Wheel::SocketFactory and POE::Wheel::ReadWrite instead.  These are
174       lower-level modules, and using them requires more effort.  They are
175       more flexible and customizable, however.
176

PUBLIC METHODS

178   new
179       new() starts a server based on POE::Component::Server::TCP and returns
180       a session ID for the master listening session.  All error handling is
181       done within the server, via the "Error" and "ClientError" callbacks.
182
183       The server may be shut down by posting a "shutdown" event to the master
184       session, either by its ID or the name given to it by the "Alias"
185       parameter.
186
187       POE::Component::Server::TCP does a lot of work in its constructor.  The
188       design goal is to push as much overhead into one-time construction so
189       that ongoing run-time has less overhead.  Because of this, the server's
190       constructor can take quite a daunting number of parameters.
191
192       POE::Component::Server::TCP always returns a POE::Session ID for the
193       session that will be listening for new connections.
194
195       Many of the constructor parameters have been previously described.
196       They are covered briefly again below.
197
198       Server Sesson Configuration
199
200       These constructor parameters affect POE::Component::Server::TCP's main
201       listening session.
202
203       TODO - Document the shutdown procedure somewhere.
204
205       Acceptor
206
207       "Acceptor" defines a CODE reference that POE::Wheel::SocketFactory's
208       "SuccessEvent" will trigger to handle new connections.  Therefore the
209       parameters passed to "Acceptor" are identical to those given to
210       "SuccessEvent".
211
212       "Acceptor" is optional; the default handler will create a new session
213       for each connection.  All the "Client" constructor parameters are used
214       to customize this session.  In other words, "CleintInput" and such are
215       not used when "Acceptor" is set.
216
217       The default "Acceptor" adds significant convenience and flexibility to
218       POE::Component::Server::TCP, but it's not always a good fit for every
219       application.  In some cases, a custom "Acceptor" or even rolling one's
220       own server with POE::Wheel::SocketFactory and POE::Wheel::ReadWrite may
221       be better and/or faster.
222
223         Acceptor => sub {
224           my ($socket, $remote_address, $remote_port) = @_[ARG0..ARG2];
225           # Set up something to interact with the client.
226         }
227
228       Address
229
230       "Address" defines a single interface address the server will bind to.
231       It defaults to INADDR_ANY or INADDR6_ANY, when using IPv4 or IPv6,
232       respectively.  It is often used with "Port".
233
234       The value in "Address" is passed to POE::Wheel::SocketFactory's
235       "BindAddress" parameter, so it may be in whatever form that module
236       supports.  At the time of this writing, that may be a dotted IPv4 quad,
237       an IPv6 address, a host name, or a packed Internet address.  See also
238       "Hostname".
239
240       TODO - Example, using the lines below.
241
242         Address => '127.0.0.1'   # Localhost IPv4
243         Address => "::1"         # Localhost IPv6
244
245       Alias
246
247       "Alias" is an optional name that will be given to the server's master
248       listening session.  Events sent to this name will not be delivered to
249       individual connections.
250
251       The server's "Alias" may be important if it's necessary to shut a
252       server down.
253
254         sub sigusr1_handler {
255           $_[KERNEL]->post(chargen_server => 'shutdown');
256           $_[KERNEL]->sig_handled();
257         }
258
259       Concurrency
260
261       "Concurrency" controls how many connections may be active at the same
262       time.  It defaults to -1, which allows POE::Component::Server::TCP to
263       accept concurrent connections until the process runs out of resources.
264
265       Setting "Concurrency" to 0 prevents the server from accepting new
266       connections.  This may be useful if a server must perform lengthy
267       initialization before allowing connections.  When the initialization
268       finishes, it can yield(set_concurrency => -1) to enable connections.
269       Likewise, a running server may yield(set_concurrency => 0) or any other
270       number to dynamically tune its concurrency.  See EVENTS for more about
271       the set_concurrency event.
272
273       Note: For "Concurrency" to work with a custom "Acceptor", the server's
274       listening session must receive a "disconnected" event whenever clients
275       disconnect.  Otherwise the listener cannot mediate between its
276       connections.
277
278       Example:
279
280         Acceptor => sub {
281           # ....
282           POE::Session->create(
283             # ....
284             inline_states => {
285               _start => sub {
286                 # ....
287                 # remember who our parent is
288                 $_[HEAP]->{server_tcp} = $_[SENDER]->ID;
289                 # ....
290               },
291               got_client_disconnect => sub {
292                 # ....
293                 $_[KERNEL]->post( $_[HEAP]->{server_tcp} => 'disconnected' );
294                 # ....
295               }
296             }
297           );
298         }
299
300       Domain
301
302       "Domain" sets the address or protocol family within which to operate.
303       The "Domain" may be any value that POE::Wheel::SocketFactory supports.
304       AF_INET (Internet address space) is used by default.
305
306       Use AF_INET6 for IPv6 support.  This constant is exported by Socket6,
307       which must be loaded before POE::Component::Server::TCP.
308
309       Error
310
311       "Error" is the callback that will be invoked when the server socket
312       reports an error.  The Error callback will be used to handle
313       POE::Wheel::SocketFactory's FailureEvent, so it will receive the same
314       parameters as discussed there.
315
316       A default error handler will be provided if Error is omitted.  The
317       default handler will log the error to STDERR and shut down the server.
318       Active connections will be permitted to to complete their transactions.
319
320         Error => sub {
321           my ($syscall_name, $err_num, $err_str) = @_[ARG0..ARG2];
322           # Handle the error.
323         }
324
325       Hostname
326
327       "Hostname" is the optional non-packed name of the interface the TCP
328       server will bind to.  The hostname will always be resolved via
329       inet_aton() and so can either be a dotted quad or a name.  Name
330       resolution is a one-time start-up action; there are no ongoing run-time
331       penalties for using it.
332
333       "Hostname" guarantees name resolution, where "Address" does not.  It's
334       therefore preferred to use "Hostname" in cases where resolution must
335       always be done.
336
337       InlineStates
338
339       "InlineStates" is optional.  If specified, it must hold a hashref of
340       named callbacks.  Its syntax is that of POE:Session->create()'s
341       inline_states parameter.
342
343       Remember: These InlineStates handlers will be added to the client
344       sessions, not to the main listening session.  A yield() in the listener
345       will not reach these handlers.
346
347       If POE::Kernel::ASSERT_USAGE is enabled, the constructor will croak()
348       if it detects a state that it uses internally. For example, please use
349       the "Started" callback if you want to specify your own "_start" event.
350
351       ObjectStates
352
353       If "ObjectStates" is specified, it must holde an arrayref of objects
354       and the events they will handle.  The arrayref must follow the syntax
355       for POE::Session->create()'s object_states parameter.
356
357       Remember: These ObjectStates handlers will be added to the client
358       sessions, not to the main listening session.  A yield() in the listener
359       will not reach these handlers.
360
361       If POE::Kernel::ASSERT_USAGE is enabled, the constructor will croak()
362       if it detects a state that it uses internally. For example, please use
363       the "Started" callback if you want to specify your own "_start" event.
364
365       PackageStates
366
367       When the optional "PackageStates" is set, it must hold an arrayref of
368       package names and the events they will handle  The arrayref must follow
369       the syntax for POE::Session->create()'s package_states parameter.
370
371       Remember: These PackageStates handlers will be added to the client
372       sessions, not to the main listening session.  A yield() in the listener
373       will not reach these handlers.
374
375       If POE::Kernel::ASSERT_USAGE is enabled, the constructor will croak()
376       if it detects a state that it uses internally. For example, please use
377       the "Started" callback if you want to specify your own "_start" event.
378
379       Port
380
381       "Port" contains the port the listening socket will be bound to.  It
382       defaults to 0, which usually lets the operating system pick a port at
383       random.
384
385         Port => 30023
386
387       It is often used with "Address".
388
389       Started
390
391       "Started" sets an optional callback that will be invoked within the
392       main server session's context.  It notifies the server that it has
393       fully started.  The callback's parameters are the usual for a session's
394       _start handler.
395
396       ListenerArgs
397
398       "ListenerArgs" is passed to the listener session as the "args"
399       parameter.  In other words, it must be an arrayref, and the values are
400       are passed into the "Started" handler as ARG0, ARG1, etc.
401
402       Connection Session Configuration
403
404       These constructor parameters affect the individual sessions that
405       interact with established connections.
406
407       ClientArgs
408
409       "ClientArgs" is optional.  When specified, it holds an ARRAYREF that
410       will be expanded one level and passed to the "ClientConnected" callback
411       in @_[ARG0..$#_].
412
413       ClientConnected
414
415       Each new client connection is handled by a new POE::Session instance.
416       "ClientConnected" is a callback that notifies the application when a
417       client's session is started and ready for operation.  Banners are often
418       sent to the remote client from this callback.
419
420       The @_[ARG0..$#_] parameters to "ClientConnected" are a copy of the
421       values in the "ClientArgs" constructor parameter's array reference.
422       The other @_ members are standard for a POE::Session _start handler.
423
424       "ClientConnected" is called once per session start-up.  It will never
425       be called twice for the same connection.
426
427         ClientConnected => sub {
428           $_[HEAP]{client}->put("Hello, client!");
429           # Other client initialization here.
430         },
431
432       ClientDisconnected
433
434       "ClientDisconnected" is a callback that will be invoked when the client
435       disconnects or has been disconnected by the server.  It's useful for
436       cleaning up global client information, such as chat room structures.
437       "ClientDisconnected" callbacks receive the usual POE parameters, but
438       nothing special is included.
439
440         ClientDisconnected => sub {
441           warn "Client disconnected"; # log it
442         }
443
444       ClientError
445
446       The "ClientError" callback is invoked when a client socket reports an
447       error.  "ClientError" is called with POE's usual parameters, plus the
448       common error parameters: $_[ARG0] describes what was happening at the
449       time of failure.  $_[ARG1] and $_[ARG2] contain the numeric and string
450       versions of $!, respectively.
451
452       "ClientError" is optional.  If omitted, POE::Component::Server::TCP
453       will provide a default callback that logs most errors to STDERR.
454
455       If "ClientShutdownOnError" is set, the connection will be shut down
456       after "ClientError" returns.  If "ClientDisconnected" is specified, it
457       will be called as the client session is cleaned up.
458
459       "ClientError" is triggered by POE::Wheel::ReadWrite's ErrorEvent, so it
460       follows that event's form.  Please see the ErrorEvent documentation in
461       POE::Wheel::ReadWrite for more details.
462
463         ClientError => sub {
464           my ($syscall_name, $error_num, $error_str) = @_[ARG0..ARG2];
465           # Handle the client error here.
466         }
467
468       ClientFilter
469
470       "ClientFilter" specifies the POE::Filter object or class that will
471       parse input from each client and serialize output before it's sent to
472       each client.
473
474       "ClientFilter" may be a SCALAR, in which case it should name the
475       POE::Filter class to use.  Each new connection will be given a freshly
476       instantiated filter of that class.  No constructor parameters will be
477       passed.
478
479         ClientFilter => "POE::Filter::Stream",
480
481       Some filters require constructor parameters.  These may be specified by
482       an ARRAYREF.  The first element is the POE::Filter class name, and
483       subsequent elements are passed to the class' constructor.
484
485         ClientFilter => [ "POE::Filter::Line", Literal => "\n" ],
486
487       "ClientFilter" may also be given an archetypical POE::Filter OBJECT.
488       In this case, each new client session will receive a clone() of the
489       given object.
490
491         ClientFilter => POE::Filter::Line->new(Literal => "\n"),
492
493       "ClientFilter" is optional.  The component will use "POE::Filter::Line"
494       if it is omitted.
495
496       Filter modules are not automatically loaded.  Be sure that the program
497       loads the class before using it.
498
499       ClientFlushed
500
501       "ClientFlushed" exposes POE::Wheel::ReadWrite's "FlushedEvent" as a
502       callback.  It is called whenever the client's output buffer has been
503       fully flushed to the client socket.  At this point it's safe to shut
504       down the socket without losing data.
505
506       "ClientFlushed" is useful for streaming servers, where a "flushed"
507       event signals the need to send more data.
508
509         ClientFlushed => sub {
510           my $data_source = $_[HEAP]{file_handle};
511           my $read_count = sysread($data_source, my $buffer = "", 65536);
512           if ($read_count) {
513             $_[HEAP]{client}->put($buffer);
514           }
515           else {
516             $_[KERNEL]->yield("shutdown");
517           }
518         },
519
520       POE::Component::Server::TCP's default "Acceptor" ensures that data is
521       flushed before finishing a client shutdown.
522
523       ClientInput
524
525       "ClientInput" defines a per-connection callback to handle client input.
526       This callback receives its parameters directly from
527       POE::Wheel::ReadWrite's "InputEvent".  ARG0 contains the input record,
528       the format of which is defined by "ClientFilter" or
529       "ClientInputFilter".  ARG1 has the wheel's unique ID, and so on.
530       Please see POE:Wheel::ReadWrite for an in-depth description of
531       "InputEvent".
532
533       "ClientInput" and "Acceptor" are mutually exclusive.  Enabling one
534       prohibits the other.
535
536         ClientInput => sub {
537           my $input = $_[ARG0];
538           $_[HEAP]{wheel}->put("You said: $input");
539         },
540
541       ClientInputFilter
542
543       "ClientInputFilter" is used with "ClientOutputFilter" to specify
544       different protocols for input and output.  Both must be used together.
545       Both follow the same usage as "ClientFilter".
546
547         ClientInputFilter  => [ "POE::Filter::Line", Literal => "\n" ],
548         ClientOutputFilter => 'POE::Filter::Stream',
549
550       ClientOutputFilter
551
552       "ClientOutputFilter" is used with "ClientInputFilter" to specify
553       different protocols for input and output.  Both must be used together.
554       Both follow the same usage as "ClientFilter".
555
556         ClientInputFilter  => POE::Filter::Line->new(Literal => "\n"),
557         ClientOutputFilter => 'POE::Filter::Stream',
558
559       ClientShutdownOnError
560
561       "ClientShutdownOnError" tells the component whether client connections
562       should be shut down automatically if an error is detected.  It defaults
563       to "true".  Setting it to false (0, undef, "") turns off this feature.
564
565       The application is responsible for dealing with client errors if this
566       feature is disabled.  Not doing so may cause the component to emit a
567       constant stream of errors, eventually bogging down the application with
568       dead connections that spin out of control.
569
570       Yes, this is terrible.  You have been warned.
571
572       SessionParams
573
574       "SessionParams" specifies additional parameters that will be passed to
575       the "SessionType" constructor at creation time.  It must be an array
576       reference.
577
578         SessionParams => [ options => { debug => 1, trace => 1 } ],
579
580       Note: POE::Component::Server::TCP supplies its own POE::Session
581       constructor parameters.  Conflicts between them and "SessionParams" may
582       cause the component to behave erratically.  To avoid such problems,
583       please limit SessionParams to the "options" hash.  See POE::Session for
584       an known options.
585
586       We may enable other options later.  Please let us know if you need
587       something.
588
589       SessionType
590
591       "SessionType" specifies the POE::Session subclass that will be created
592       for each new client connection.  "POE::Session" is the default.
593
594         SessionType => "POE::Session::MultiDispatch"
595

EVENTS

597       It's possible to manipulate a TCP server component by sending it
598       messages.
599
600   Main Server Commands
601       These events must be sent to the main server, usually by the alias set
602       in its Alias parameter.
603
604       disconnected
605
606       The "disconnected" event informs the TCP server that a connection was
607       closed.  It is needed when using Concurrency with an Acceptor callback.
608       The custom Acceptor must provide its own disconnect notification so
609       that the server's connection counting logic works.
610
611       Otherwise Concurrency clients will be accepted, and then no more.  The
612       server will never know when clients have disconnected.
613
614       set_concurrency
615
616       "set_concurrency" set the number of simultaneous connections the server
617       will be willing to accept.  See Concurrency for more details.
618       "set_concurrency" must have one parameter: the new maximum connection
619       count.
620
621         $kernel->call("my_server_alias", "set_concurrency", $max_count);
622
623       shutdown
624
625       The "shutdown" event starts a graceful server shutdown.  No new
626       connections will be accepted.  Existing connections will be allowed to
627       finish.  The server will be destroyed after the last connection ends.
628
629   Per-Connection Commands
630       These commands affect each client connection session.
631
632       shutdown
633
634       Sending "shutdown" to an individual client session instructs the server
635       to gracefully shut down that connection.  No new input will be
636       received, and any buffered output will be sent before the session ends.
637
638       Client sessions usually yield("shutdown") when they wish to disconnect
639       the client.
640
641         ClientInput => sub {
642           if ($_[ARG0] eq "quit") {
643             $_[HEAP]{client}->put("B'bye!");
644             $_[KERNEL]->yield("shutdown");
645             return;
646           }
647
648           # Handle other input here.
649         },
650

Reserved HEAP Members

652       Unlike most POE modules, POE::Component::Server::TCP stores data in the
653       client sessions' HEAPs.  These values are provided as conveniences for
654       application developers.
655
656   HEAP Members for Master Listening Sessions
657       The master listening session holds different data than client
658       connections.
659
660       alias
661
662       $_[HEAP]{alias} contains the server's Alias.
663
664       concurrency
665
666       $_[HEAP]{concurrency} remembers the server's "Concurrency" parameter.
667
668       connections
669
670       $_[HEAP]{connections} is used to track the current number of concurrent
671       client connections.  It's incremented whenever a new connection is
672       accepted, and it's decremented whenever a client disconnects.
673
674       listener
675
676       $_[HEAP]{listener} contains the POE::Wheel::SocketFactory object used
677       to listen for connections and accept them.
678
679   HEAP Members for Connection Sessions
680       These data members exist within the individual connections' sessions.
681
682       client
683
684       $_[HEAP]{client} contains a POE::Wheel::ReadWrite object used to
685       interact with the client.  All POE::Wheel::ReadWrite methods work.
686
687       got_an_error
688
689       $_[HEAP]{got_an_error} remembers whether the client connection has
690       already encountered an error.  It is part of the shutdown-on-error
691       procedure.
692
693       remote_ip
694
695       $_[HEAP]{remote_ip} contains the remote client's numeric address in
696       human-readable form.
697
698       remote_port
699
700       $_[HEAP]{remote_port} contains the remote client's numeric socket port
701       in human-readable form.
702
703       remote_addr
704
705       $_[HEAP]{remote_addr} contains the remote client's packed socket
706       address in computer-readable form.
707
708       shutdown
709
710       $_[HEAP]{shutdown} is true if the client is in the process of shutting
711       down.  The component uses it to ignore client input during shutdown,
712       and to close the connection after pending output has been flushed.
713
714       shutdown_on_error
715
716       $_[HEAP]{shutdown_on_error} remembers whether the client connection
717       should automatically shut down if an error occurs.
718

SEE ALSO

720       The SEE ALSO section in POE contains a table of contents covering the
721       entire POE distribution.
722
723       POE::Component::Client::TCP is the client-side counterpart to this
724       module.
725
726       This component uses and exposes features from POE::Filter,
727       POE::Wheel::SocketFactory, and POE::Wheel::ReadWrite.
728

BUGS

730       This looks nothing like what Ann envisioned.
731
732       This component currently does not accept many of the options that
733       POE::Wheel::SocketFactory does.
734
735       This component will not bind to several addresses at once.  This may be
736       a limitation in SocketFactory, but it's not by design.
737
738       This component needs better error handling.
739
740       Some use cases require different session classes for the listener and
741       the connection handlers.  This isn't currently supported.  Please send
742       patches. :)
743
744       TODO - Document that Reuse is set implicitly.
745

AUTHORS & COPYRIGHTS

747       POE::Component::Server::TCP is Copyright 2000-2009 by Rocco Caputo.
748       All rights are reserved.  POE::Component::Server::TCP is free software,
749       and it may be redistributed and/or modified under the same terms as
750       Perl itself.
751
752       POE::Component::Server::TCP is based on code, used with permission,
753       from Ann Barcomb <kudra@domaintje.com>.
754
755       POE::Component::Server::TCP is based on code, used with permission,
756       from Jos Boumans <kane@cpan.org>.
757
758
759
760perl v5.12.1                      2010-04-03    POE::Component::Server::TCP(3)
Impressum