On Sun, 05 Dec 2004 20:17:31 +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?
 
if __name__ == '__main__':
        bert1 = Botling("^berty^", "#exciting", "irc.interesting.org")
        bert2=Botling("^berty^", "#interesing", "irc.exciting.org")

        bert1.connectBot()
        bert2.connectBot()
        
        while 1:
                bert1.receiveData()
                bert2.receiveData()
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to