<!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">
I have the following code<br>
<br>
<tt>def receive(self,mysocket=None):
&nbsp;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; stack=self
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "Stack.receive"
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #raise Exception
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while 1:
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #try:
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "while"
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if mysocket:
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; res= mysocket.recvfrom(8192)
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else:
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; res = self.s.recvfrom(8192)
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #PROFILEIN("recv")
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "res=",res</tt><br>
<br>
the socket is a stacklesssocket.<br>
when I call the thing I ought to get a result, or nothing as asyncore
is non-blocking. However I was not expecting to be dropped back up the
stack to the beginning of the Threading.thread (or the stackless thread
for that matter) that spawned the thing without as much as an exception!<br>
<br>
I am getting the following output:<br>
<tt>dispatcher loop<br>
Stack.receive<br>
while<br>
dispatcher loop<br>
Stack.receive<br>
while<br>
dispatcher loop<br>
Stack.receive<br>
while</tt><br>
<br>
<br>
etc.... Well that tells me that the recvfrom throws me back down the
function stack. I am baffled as to why.<br>
<br>
Can someone <i>please</i> explain this to me? (and of course what I
should to to get the expected result)<br>
Paul<br>
<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>