[Twisted-Python] MultiService puzzler
donwsmith at gmail.com
Wed Dec 12 00:08:30 EST 2007
I'm trying to build an app using MultiService. I need to have 2 services,
one that listens for UDP datagrams and another that can send those datagrams
to an ActiveMQ server via a Stomp client.
I can set up the two services just fine, but I'm stuck with how to call the
MQ service send method from the UDPServer instance.
Some code to illustrate:
def datagramReceived(self, datagram, address):
#Send datagram to the queue server
# I don't know how to access the send method for the Stomp client
testq = internet.TCPClient(APPVARIABLES['queue_server'],
#create a UDP listener
#TODO: this should be driven by the config file
# Create an application as normal
application = service.Application("MQExample")
# Connect our MultiService to the application, just like a normal service.
Note: this is won't run exactly as is, but should give an idea of my
problem. I've setup the ActiveMQ Stomp client as 'testq'. I've setup the
UDPServer service to listen for UDP packets. I can get the UDP packets and
print them, but I can't figure out how to hand them to my Stomp client's
send() method. This is possible, right?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python