IO::Mux::Service::TCP - TCP (socket) based service


IO-Mux documentation  | view source Contained in the IO-Mux distribution.

Index


NAME

Top

IO::Mux::Service::TCP - TCP (socket) based service

INHERITANCE

Top

 IO::Mux::Service::TCP
   is a IO::Mux::Handler::Service
   is a IO::Mux::Handler

 IO::Mux::Service::TCP is extended by
   IO::Mux::HTTP::Server

DESCRIPTION

Top

Accept TCP connections. When a connection arrives, it will get handled by a new object which gets added to the multiplexer as well.

METHODS

Top

Constructors

IO::Mux::Service::TCP->new(OPTIONS)
 -Option   --Defined in     --Default
  conn_opts                   []
  conn_type                   <required>
  fh         IO::Mux::Handler  <required>
  name       IO::Mux::Handler  'listen tcp $host:$port'

conn_opts => ARRAY

Pass some extra options when objects of conn_type are created.

conn_type => CLASS|CODE

The CLASS (package name) of client to be created for each new contact. This CLASS must extend IO::Mux::Net::TCP. You may also provide a CODE reference which will be called with the socket leading to the client.

fh => FILEHANDLE
name => STRING

IO::Mux::Service::TCP->open(MODE, WHAT, OPTIONS) See "Constructors" in IO::Mux::Handler

Accessors

$obj->clientType
$obj->fh See "Accessors" in IO::Mux::Handler
$obj->fileno See "Accessors" in IO::Mux::Handler
$obj->mux See "Accessors" in IO::Mux::Handler
$obj->name See "Accessors" in IO::Mux::Handler
$obj->socket
$obj->usesSSL See "Accessors" in IO::Mux::Handler

User interface

Connection

$obj->close([CALLBACK]) See "Connection" in IO::Mux::Handler
$obj->timeout([TIMEOUT]) See "Connection" in IO::Mux::Handler

Multiplexer

Connection

$obj->mux_init(MUX, [HANDLER]) See "Connection" in IO::Mux::Handler
$obj->mux_remove See "Connection" in IO::Mux::Handler
$obj->mux_timeout See "Connection" in IO::Mux::Handler

Reading

$obj->mux_except_flagged(FILENO) See "Reading" in IO::Mux::Handler
$obj->mux_read_flagged(FILENO) See "Reading" in IO::Mux::Handler

Writing

$obj->mux_write_flagged(FILENO) See "Writing" in IO::Mux::Handler

Service

$obj->mux_connection(CLIENT) See "Service" in IO::Mux::Handler::Service

Helpers

$obj->extractSocket(HASH)
IO::Mux::Service::TCP->extractSocket(HASH) See "Helpers" in IO::Mux::Handler
$obj->fdset(STATE, READ, WRITE, ERROR) See "Helpers" in IO::Mux::Handler
$obj->show See "Helpers" in IO::Mux::Handler

SEE ALSO

Top

This module is part of IO-Mux distribution version 0.11, built on January 26, 2011. Website: http://perl.overmeer.net/ All modules in this suite: Any::Daemon, IO::Mux, and IO::Mux::HTTP.

Please post questions or ideas to perl@overmeer.net

LICENSE

Top

Copyrights 2011 by Mark Overmeer. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html


IO-Mux documentation  | view source Contained in the IO-Mux distribution.