<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><font size="2">I am trying to use twisted to build an application that can act as server as well as client at the same time.<br>
I need this application to send and receive messages back and forth between two of its instances.<br>
<br>
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.<br>
<br>
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?<br>
<br>
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.</font></td></tr></table><br>