[Twisted-Python] Is AMP a bidirectional protocol?
Drew Smathers
drew.smathers at gmail.com
Wed Feb 27 13:47:02 MST 2008
On Wed, Feb 27, 2008 at 2:09 PM, Nathan <nathan.stocks at gmail.com> wrote:
> On Wed, Feb 27, 2008 at 11:50 AM, Drew Smathers <drew.smathers at gmail.com> wrote:
> > On Wed, Feb 27, 2008 at 12:57 PM, Nathan <nathan.stocks at gmail.com> wrote:
> > > Is the AMP protocol bidirectional (beyond the response you get to each
> > > message)?
> >
> > Yes:
> > http://djfroofy.livejournal.com/3509.html
>
> Drew, you're everywhere!
>
> Ok, so next question:
>
> How do you access the callRemote method from outside the protocol
> itself on the server side? In the example above, from the server's
> main() could you call pf.protocol.CallRemote()?
>
I think looking at David's chat demo will steer you in the right direction:
http://ripton.net/hg/ampchat/file/90a4007ef2a7/chatserver.py
In a nutshell - just keep them in list or dict bound to the factory
and be sure to do cleanup on connectionLost.
--
\\\\\/\"/\\\\\\\\\\\
\\\\/ // //\/\\\\\\\
\\\/ \\// /\ \/\\\\
\\/ /\/ / /\/ /\ \\\
\/ / /\/ /\ /\\\ \\
/ /\\\ /\\\ \\\\\/\
\/\\\\\/\\\\\/\\\\\\
d.p.s
More information about the Twisted-Python
mailing list