[Twisted-Python] Help With Twisted as a Client (newbie warning)

Steve Milner smilner at trinityz.com
Thu Feb 17 09:25:49 MST 2005


I'm trying to get a better handle on how to write a client using twisted 
that would react to a GUI. What I am wanting to do is to somehow be able 
to work with xmlclient (which is based in sux.XMLParser) so I can write 
to the transport. Here is the connection code:

<snip>
# Overrides the protocol.XlientFactory with a bit of reconnect code and sets
# the protocol to xmlclient
factory = CUClientFactory()

factory.clients = []
sslFactory = ClientContextFactory()
application = service.Application("xmlclient")
reactor.connectSSL("__example__.com", 1026, factory, sslFactory)
</snip>

Is there a way I can access xmlxlient inside application? Is there a 
different way I should send data to the server? I can send data if I 
explicitly say so inside xmlclient, but what I am wanting to do is to 
send it due to outside sources (like a button click or key press). 
Something like this:

<bad code>
application.xmlparser.transport.write("testing")
</bad code>

I've spent a few hours searching through google and the examples/docs 
but haven't found out how to do this (or even if it is the right line of 
thinking). All help is greatly appreciated!

Thanks,
Steve




More information about the Twisted-Python mailing list