[Twisted-Python] server client in one code

khawar hasham hasham_james_007 at yahoo.com
Thu Feb 26 12:46:21 MST 2009


I am trying to use twisted to build an application that can act as server as well as client at the same time.

I need this application to send and receive messages back and forth between two of its instances.



I used the reactor.run() to start listen and connectTCP. My problem is
that I need to run server or client module from other program. Moreover, I cannot put the
calling module on hold because reactor.run() stops every other
execution of your code. To make it work, I started the reactor.run in a
separate thread with installSignalHanlder=0.



I have got the success to transfer messages between two instances if
one is acting as server and other as client. However, I could not send
messages if both instances started as servers and then start sending
the messages to each other. I tried to google around but could not find
the solution. Can you help me in this?



I can not start server as independent module. I have to start it from
other python script that will use my module to act as server as well as
client to send and receive the messages.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20090226/7ab4159e/attachment.html>


More information about the Twisted-Python mailing list