[Twisted-Python] Is AMP a bidirectional protocol?

David Ripton dripton at ripton.net
Wed Feb 27 14:10:19 EST 2008

On 2008.02.27 10:57:03 -0700, Nathan wrote:
> Is the AMP protocol bidirectional (beyond the response you get to each
> message)?  


> I'm really new to Twisted, and I followed the ampserver.py
> and ampclient.py examples to get an AMP connection working, because
> someone suggested that to me as an easy protocol to start with.
> Although sending a message from the client to the server works fine, I
> can't figure out how to initiate a message from the server to the
> client over the connection that the client initially created.
> I'm working on a little project where the "server" and the "client"
> actually need to talk more like peers where each can initiate a
> message to the other.  The server is outside the NAT, so it'd be best
> if the communication could happen both ways over the connection that
> the client initiates.
> Could someone point me in the right direction?  I can provide my
> existing code if that makes any difference.

It was non-obvious to me too.

You call callRemote on the server-side Protocol to send a message to the
client side.

I have a little demonstration PyGTK / AMP chat program at

David Ripton    dripton at ripton.net

More information about the Twisted-Python mailing list