How to make a socket.recv with nonblock?

张少驰 zhangsc at neusoft.com
Mon Dec 17 20:42:56 EST 2001


I have a program like that:
HOST=''
PORT=21567
ADDR=(HOST,PORT)
udpSerSock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
udpSerSock.bind(ADDR)
ipsock=socket.socket(socket.AF_INET,10,8)
while 1:
 recvpack=ipsock.recv(1024)
 ....
 data,addr=udpSerSock.recvfrom(1024) #I want to only make this sentence with nonblock at port 21567
                                     #notice that this sentence is in loop.
 ....

How to realize this function ? I'm a newbie ,Would you give me detailed step to  correct my program ?Thanks.
       
Edward                
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20011218/58e7f5d4/attachment.html>


More information about the Python-list mailing list