<DIV id=RTEContent>Hi all!&nbsp; After I asked someone to take a look at our legacy app setup, this code seems to work now!<BR><BR><B><I>john peter &lt;neuzhoundxx@yahoo.com&gt;</I></B> wrote:  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">  <DIV>This client code is making connections to a legacy app.&nbsp; I do have Java code that simulates what the server side essentially does and this client code does seem to</DIV>  <DIV>work as expected when run against that server code:</DIV>  <DIV>&nbsp;</DIV>  <DIV>commandline=python dd.py localhost 140 W04FSRV W04PS01 2</DIV>  <DIV>&nbsp;</DIV>  <DIV>buildProtocol with myName= W04PS01 instanceName= conn1</DIV>  <DIV>conn1 connection made. requesting session establishment ...<BR>myName= W04PS01&nbsp;&nbsp; remoteName= W04FSRV</DIV>  <DIV>buildProtocol with myName= W04BS03 instanceName= conn2</DIV>  <DIV>conn2 connection made. requesting session establishment ...<BR>myName=
 W04BS03&nbsp;&nbsp; remoteName= W04FSRV</DIV>  <DIV>conn1 Server said: '\x82\x00\x00\x00'<BR>conn1 Positive Service Response Packet received!<BR>conn1 TRANS CODE= 998</DIV>  <DIV>conn1 sending server data ...<BR>conn1 finished sending server data<BR>conn1 connection lost<BR>conn1 Connection lost - goodbye!<BR>conn2 Server said: '\x82\x00\x00\x00'<BR>conn2 Positive Service Response Packet received!<BR>conn2 TRANS CODE= 998</DIV>  <DIV>conn2 sending server data ...<BR>conn2 finished sending server data<BR>conn2 connection lost<BR>conn2 Connection lost - goodbye!<BR></DIV>  <DIV>-------------------------------------------------------------------</DIV>  <DIV>When run against the legacy app on &lt;ip address&gt;, only one connection seems to be </DIV>  <DIV>working (see output below).&nbsp; Also, when I run the code one connection at a time, </DIV>  <DIV>the code works.</DIV>  <DIV>&nbsp;</DIV>  <DIV>Any suggestion what I can do on the client side to help me debug?</DIV>  <DIV>I noticed
 there's log.msg()'s in the twisted code.&nbsp; Would they have printed out</DIV>  <DIV>on the dos console (i'm using windows xp as the client machine) if they had</DIV>  <DIV>occurred?</DIV>  <DIV>&nbsp;</DIV>  <DIV>Also, one difference between the two "invocations" (connecting to java server code vs connecting to legacy app) is the port. For connecting to the java server code on localhost, the "remote" port is 140; for connecting&nbsp; to the legacy app, the remote port</DIV>  <DIV>is the usual NBT port 139. i don't think this should matter; just thought i'd mention it...</DIV>  <DIV>&nbsp;</DIV>  <DIV>commandline= python dd.py&nbsp;&lt;ip address&gt;&nbsp;139 W04FSRV W04PS01 2<BR></DIV>  <DIV>buildProtocol with myName= W04PS01 instanceName= conn1</DIV>  <DIV>conn1 connection made. requesting session establishment ...<BR>myName= W04PS01&nbsp;&nbsp; remoteName= W04FSRV</DIV>  <DIV>buildProtocol with myName= W04BS03 instanceName= conn2</DIV>  <DIV>conn2 connection made. requesting
 session establishment ...<BR>myName= W04BS03&nbsp;&nbsp; remoteName= W04FSRV</DIV>  <DIV>conn2 Server said: '\x82\x00\x00\x00'<BR>conn2 Positive Service Response Packet received!<BR>conn2 TRANS CODE= 998</DIV>  <DIV>conn2 sending server data ...<BR>conn2 finished sending server data<BR>conn2 connection lost<BR>conn2 Connection lost - goodbye!<BR><B><I></I></B></DIV>  <DIV><B><I>glyph@divmod.com</I></B> wrote:</DIV>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>On Fri, 3 Feb 2006 07:42:27 -0800 (PST), john peter <NEUZHOUNDXX@YAHOO.COM>wrote:<BR><BR>&gt; With my initial attempt using Twisted, only one connection seems to succeed, and the other basically hangs.<BR><BR>This isn't quite a "minimal" example, since I don't have access to the server side that this code is expecting to talk to. Have you tried setting up a simpler server which does a listenTCP and then a server which does connectTCP to it multiple times? Does that
 work?<BR><BR>One thing that occurs to me is that if the first byte of the connection is not \x82 it will be disconnected immediately; the dataReceived you've written doesn't actually parse any protocol data. Depending on which prints are actually commented out or not that might look like hanging :)<BR><BR>_______________________________________________<BR>Twisted-Python mailing list<BR>Twisted-Python@twistedmatrix.com<BR>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python<BR></BLOCKQUOTE>  <DIV><BR></DIV>  <div>  <HR SIZE=1>  <A href="http://us.rd.yahoo.com/mail_us/taglines/virusmail/*http://mail.yahoo.com">Yahoo! Mail</A> - Helps protect you from nasty viruses._______________________________________________<BR>Twisted-Python mailing list<BR>Twisted-Python@twistedmatrix.com<BR>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python<BR></BLOCKQUOTE><BR></DIV><p>
        
                <hr size=1> <a href="http://us.rd.yahoo.com/mail_us/taglines/virusmail/*http://mail.yahoo.com">Yahoo! Mail</a> - Helps protect you from nasty viruses.