<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
OK progress. After ditching any reference to threading.Thread and going
stackless all the way I now have a working stackless server. <br>
<br>
However the client side seems to be the problem. connect on the UDP
socket I created blocks. See the code below:<br>
<br>
<blockquote>python2.5<br>
Python 2.5 Stackless 3.1b3 060516 (python-2.5:53777, Feb 14 2007,
14:35:12)<br>
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
&gt;&gt;&gt; import stacklesssocket&nbsp; as socket<br>
&gt;&gt;&gt; s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)<br>
&gt;&gt;&gt; s.setblocking(1)<br>
&gt;&gt;&gt; s.connect(('192.168.0.145',42420))<br>
Traceback (most recent call last):<br>
&nbsp; File "&lt;stdin&gt;", line 1, in &lt;module&gt;<br>
&nbsp; File "/media/ORCA/src/stacklesssocket.py", line 135, in connect<br>
&nbsp;&nbsp;&nbsp; asyncore.dispatcher.connect(self, address)<br>
&nbsp; File "/usr/local/lib/python2.5/asyncore.py", line 314, in connect<br>
&nbsp;&nbsp;&nbsp; self.handle_connect()<br>
&nbsp; File "/media/ORCA/src/stacklesssocket.py", line 185, in handle_connect<br>
&nbsp;&nbsp;&nbsp; self.connectChannel.send(None)<br>
StopIteration: the main tasklet is sending without a receiver available.<br>
</blockquote>
No packet is sent btw. It does this with s.setblocking(1) and without.
I got the error above when I pressed ctrl-C. <br>
<br>
This is the right way to set up a regular socket, but apparently not a
stacklessocket. Did I do something wrong or did I trigger a bug in
stacklesssocket?<br>
<br>
Paul<br>
<br>
<br>
<br>
Paul Sijben wrote:
<blockquote cite="mid45E30EE0.7030504@eemvalley.com" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Do^h, I am feeling very stupid.&nbsp; My loop and my problem with the test
prog was the same issue. You can not do a recvfrom&nbsp; on a non-blocking
socket, and <i>unlike</i> the regular socket, on asyncore sockets are
non-blocking <i>by default! </i>Setting the stacklesssocket I made to
blocking sorted that problem. <br>
  <br>
Now I seem to be losing packets. wireshark tells me they are delivered
to the machine, however my not blocking recvfrom does not return. But
this is not in the test program only in the full one. <br>
  <br>
So tomorrow I'll compare it the other way around. <br>
  <br>
One question, what would cause stackless.run() to block?<br>
  <br>
Paul<br>
  <br>
Paul Sijben wrote:
  <blockquote cite="mid45E30221.4020303@eemvalley.com" type="cite">
    <pre wrap="">working on it. for some strange reason the stacklesssocket tells me
    res = self.s.recvfrom(8192)
error: (11, 'Resource temporarily unavailable')

yet I seem to have all the socket related stuff in the little script...

I'll post the script when it works.

Richard Tew wrote:
  </pre>
    <blockquote type="cite">
      <pre wrap="">On 2/26/07, Paul Sijben <a
 class="moz-txt-link-rfc2396E" href="mailto:sijben@eemvalley.com">&lt;sijben@eemvalley.com&gt;</a> wrote:
    </pre>
      <blockquote type="cite">
        <pre wrap=""> etc.... Well that tells me that the recvfrom throws me back down the
function stack. I am baffled as to why.

 Can someone please explain this to me? (and of course what I should
to to
get the expected result)
      </pre>
      </blockquote>
      <pre wrap="">Hi Paul,

Can you please provide a standalone script which when run reproduces
this?

Thanks,
Richard.
    </pre>
    </blockquote>
    <pre wrap=""><!---->
  </pre>
  </blockquote>
  <br>
  <pre class="moz-signature" cols="72">-- 
Paul Sijben                            tel: +31334566488
Eemvalley Technology               fax: +31334557523
the Netherlands                        <a class="moz-txt-link-freetext"
 href="http://eemvalley.com">http://eemvalley.com</a>    
  </pre>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Stackless mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Stackless@stackless.com">Stackless@stackless.com</a>
<a class="moz-txt-link-freetext" href="http://www.stackless.com/mailman/listinfo/stackless">http://www.stackless.com/mailman/listinfo/stackless</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Paul Sijben                            tel: +31334566488
Eemvalley Technology               fax: +31334557523
the Netherlands                        <a class="moz-txt-link-freetext" href="http://eemvalley.com">http://eemvalley.com</a>    
</pre>
</body>
</html>