[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-03 Thread Steve
Michael, I was reviewing the TCPClient.py code. In the runClient method you have: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM); yield 0.3 self.sock = sock # We need this for shutdown later try: sock.setblocking(0); yield 0.6 try:

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-03 Thread Michael Sparks
On Tuesday 03 March 2009 19:26:57 Steve wrote: Michael, I was reviewing the TCPClient.py code.   Many thanks for this. As a preface to what follows, I've put a different implementation into TCPClient - in line with my comments yesterday. The reason is to allow TCPClient to continue to not

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-03 Thread Steve
class TCPClient(Axon.Component.component): def __init__(self,host,port,delay=0,connect_timeout=60): self.connect_timeout = connect_timeout ... connect_start = time.time() while not self.safeConnect(sock,(self.host, self.port)):

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-03 Thread Steve
Thinko, I meant:                waitTill = time.time() + self.connect_timeout                while not self.safeConnect(sock,(self.host, self.port)):                   if self.shutdown():                       return                   if time.time() = waitTill:                      

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-02 Thread Steve
Oh heck, this bug is in the underlying TCPClient! After spending days developing against localhost, I now find that I can't go live without having to do manual name resolution. :( --Steve On Mar 2, 1:39 am, Steve unetright.thebas...@xoxy.net wrote: FYI SingleShotHTTPClient on windows

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-02 Thread Michael Sparks
On Monday 02 March 2009 09:49:36 Steve wrote: Oh heck, this bug is in the underlying TCPClient!  After spending days developing against localhost, I now find that I can't go live without having to do manual name resolution.   That really should not be a problem (ie I've not seen that problem

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-02 Thread Michael Sparks
On Monday 02 March 2009 09:39:02 Steve wrote: SingleShotHTTPClient on windows vista goes nuts opening thousands of ports when making a connection to an address which requires name resolution and which includes a port number. 1 SingleShotHTTPClient('http://www.google.com/') = OK Google is

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-02 Thread Michael Sparks
On Monday 02 March 2009 09:49:36 Steve wrote: Oh heck, this bug is in the underlying TCPClient!  After spending days developing against localhost, I now find that I can't go live without having to do manual name resolution.  :( I've done some digging. There's definitely something odd going on

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-02 Thread Steve
Michael, Thank you for taking a look at this. I slimmed down my test case to just: from Kamaelia.Internet.TCPClient import TCPClient if __name__ == '__main__': TCPClient('www.google.com', 80).run() I also tested with this line instead: TCPClient('127.0.0.1', 80).run() I was thrown

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-02 Thread Michael Sparks
Hi Steve, This email may read a little odd. I've been writing this whilst reading and trying things out, saw your update, and having had a thought. As a result the train of thought changes as I go through this, but I've left that in since it may be of use. On Monday 02 March 2009 21:11:53

[kamaelia-list] Re: Bug in SingleShotHTTPClient

2009-03-02 Thread Steve
Michael, Thank you again for looking into this. Also, I don't have a lot of network code experience in python, so please take all this with ample salt. I'm beginning to think I ought to start up a windows VM and see if I can reproduce this there. I would like to see big K be well supported