client derived from async_chat

Patrick Useldinger pu
Sun Aug 17 18:30:57 EDT 2003


Patrick Useldinger wrote:

>   File "I:\My Programs\sas\sasLA0.py", line 18, in ?
>     response=sock.recv(BUFFSIZE)
> socket.error: (10035, 'The socket operation could not complete without 
> blocking')

To be even more precise, the 10035 (EWOULDBLOCK) already happens when I 
do a connect():

20030818-001054 connecting to EB on 127.0.0.1:16385
connect rc= 10035  <==============================
   File "I:\My Programs\sas\sasLA0.py", line 18, in ?
     response=sock.recv(BUFFSIZE)
socket.error: (10035, 'The socket operation could not complete without 
blocking')

This is exactly what happens in my previous code:

class Server(SingleServer):
     def __init__(self,message,*args):
         self.log_info('Server:__init__')
         SingleServer.__init__(self,*args)
         self.create_socket(socket.AF_INET,socket.SOCK_STREAM)
         print now(),'connecting to EM on %s:%s' % (EBHost,EBPort)
         self.connect((EBHost,EBPort))
     def handle_connect(self):
         self.log_info('Server:handle_connect')
         print now(),'sending %s' % repr(message)
         self.push(message+BLOCKEND)
     def processData(self,data):
         self.log_info('Server:processData')
         print now(),'received "%s"' % repr(response)
         self.close()

I.e. issuing a connect() right after the socket creation in non-blocking 
  mode yields this error message, so my questions are:

1- what does it mean?
2- using async_chat, *where* should I place my connect() if not 
immediately after the socket creation?

I didn't have the problem in my server class as the bind() method seems 
to work independently whether the socket is blocking or non-blocking.

-- 
Real e-mail address is 'cHVAdm8ubHU=\n'.decode('base64')
Visit my Homepage at http://www.homepages.lu/pu/





More information about the Python-list mailing list