home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_1215a321d9f6849b47a61a8a9a8215cf
< prev
next >
Wrap
Text File
|
2000-03-23
|
5KB
|
131 lines
<HTML>
<HEAD>
<TITLE>POE::Wheel - POE Protocol Logic Abstraction</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> POE::Wheel - POE Protocol Logic Abstraction</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#public wheel methods">PUBLIC WHEEL METHODS</A></LI>
<LI><A HREF="#see also">SEE ALSO</A></LI>
<LI><A HREF="#bugs">BUGS</A></LI>
<LI><A HREF="#authors & copyrights">AUTHORS & COPYRIGHTS</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>POE::Wheel - POE Protocol Logic Abstraction</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
$wheel = new POE::Wheel::Something( ... )
$wheel->put($some_logical_data_chunks);</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>Wheels provide standard, reusable protocol logic. They use filters
and drivers to do the actual work. They are designed to manage the
resources and objects they are given, so programs generally should not
bother keeping separate references to them.</P>
<P>Wheels mainly work with files. They usually add and remove states to
handle select events in the sessions that create them. Creating a
wheel on behalf of another session will not do what you expect.
Likewise, calling another wheel's methods will do Strange Things,
because a certain level of privacy was assumed while writing them.</P>
<P>
<HR>
<H1><A NAME="public wheel methods">PUBLIC WHEEL METHODS</A></H1>
<UL>
<LI>
POE::Wheel::new( ... )
<P>The <CODE>new()</CODE> method creates and initializes a new wheel. Part of a
wheel's initialization involves adding states to its parent session
(the one that is calling the <CODE>new()</CODE> method) and registering them with
the kernel (usually through POE::Kernel::select() calls).
Instantiating wheels on behalf of other sessions will not work as
expected, if at all.</P>
<P>Because wheels have wildly different purposes, they tend also to have
wildly different constructors.</P>
<P></P>
<LI>
POE::Wheel::DESTROY()
<P>The <CODE>DESTROY()</CODE> method removes the wheel's states from its parent
session and cleans up the wheel's other resources. It's called
implicitly when the parent session lets go of the wheel's reference.</P>
<P><STRONG>Important note:</STRONG> When passing a filehandle between wheels, you must
ensure that the old wheel is destroyed before creating the new one.
This is necessary because destruction of the old wheel will remove all
the selects for the filehandle. That will undo any selects set by a
new wheel, preventing the new wheel from seeing any file activity.</P>
<P></P>
<LI>
POE::Wheel::put()
<P>Wheels hide their resources behind a high-level interface. Part of
that interface is the <CODE>put()</CODE> method, which calls Filter and Driver
<CODE>put()</CODE> methods as needed.</P>
<P></P>
<LI>
POE::Wheel::event(...)
<P>Wheels emit events for different things. The <CODE>event()</CODE> method lets a
session change the events its wheels emit at runtime.</P>
<P>The <CODE>event()</CODE> method's parameters are pairs of event types (defined by
wheels' /^.*State$/ constructor parameters) and events to emit. If
the event to emit is undef, then the wheel won't emit an event for the
condition.</P>
<P>For example:</P>
<PRE>
$wheel->event( InputState => 'new_input_state',
ErrorState => undef,
FlushedState => 'new_flushed_state',
);</PRE>
<P></P></UL>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P>POE::Wheel; POE::Wheel::FollowTail; POE::Wheel::ListenAccept;
POE::Wheel::ReadWrite; POE::Wheel::SocketFactory</P>
<P>
<HR>
<H1><A NAME="bugs">BUGS</A></H1>
<P>Wheels are fine for what they do, but they tend to be limiting when
they're used in more interesting ways.</P>
<P>
<HR>
<H1><A NAME="authors & copyrights">AUTHORS & COPYRIGHTS</A></H1>
<P>Please see the POE manpage.</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> POE::Wheel - POE Protocol Logic Abstraction</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>