help using sockets, and OOP?

Dfenestr8 chrisdewinN0SPAM at yahoo.com.au
Mon Dec 6 18:04:21 CET 2004


On Sun, 05 Dec 2004 22:29:26 +0000, Jp Calderone wrote:

>> >   Your problem doesn't seem to have anything to do with "OOP"
>> >   (whatever that is).  Rather, you are trying to use two blocking
>> >   sockets at once.
>> > 
>> >   socket.connect() and socket.recv() are both "blocking" operations by
>> >   default - they can take an arbitrary amount of time to return.
>> >   Additionally, Botling.receiveData, one of your own functions, is
>> >   also blocking: it will actually loop forever, never returning (until
>> >   an exception blows it up).  So execution of your program never even
>> >   _gets_ to the "bert2 = ..." line.  It's stuck running
>> >   bert1.receiveData().
>> 
>> 
>> Ok, so what if I remove the while loop from the Botling class, and
>> include it in the __main__ ? Might this work as a solution then?
> 
>   No.

Ok, so are there other types of sockets that aren't "blocking" ?




More information about the Python-list mailing list