Re: Non-blocking connect

2008-05-02 Thread Jean-Paul Calderone
On Fri, 02 May 2008 14:38:47 -0400, Roy Smith <[EMAIL PROTECTED]> wrote: In article <[EMAIL PROTECTED]>, mp <[EMAIL PROTECTED]> wrote: Thanks Roy. I was just trying to understand someone else's code, but in the end it turns out that this was just a bug. What weirded me out was how injecting a

Re: Non-blocking connect

2008-05-02 Thread Roy Smith
In article <[EMAIL PROTECTED]>, mp <[EMAIL PROTECTED]> wrote: > Thanks Roy. I was just trying to understand someone else's code, but > in the end it turns out that this was just a bug. > > What weirded me out was how injecting a print statement preventing the > error from occurring, but now I g

Re: Non-blocking connect

2008-05-02 Thread mp
Thanks Roy. I was just trying to understand someone else's code, but in the end it turns out that this was just a bug. What weirded me out was how injecting a print statement preventing the error from occurring, but now I get it. Without blocking, the connection handshake occurs in parallel after

Re: Non-blocking connect

2008-05-02 Thread Roy Smith
In article <[EMAIL PROTECTED]>, mp <[EMAIL PROTECTED]> wrote: > Code is at bottom. Basically, if I turn off socket blocking prior to > connecting, I get a "Socket is not connected" error when I try to send > data. However, if I do not turn off blocking, OR if I place a print > statement anywhere

Non-blocking connect

2008-05-02 Thread mp
Code is at bottom. Basically, if I turn off socket blocking prior to connecting, I get a "Socket is not connected" error when I try to send data. However, if I do not turn off blocking, OR if I place a print statement anywhere before the send call, it works! WTF? I'd like to understand what's goin