
14 Jan
2010
14 Jan
'10
3:15 a.m.
Hi again, 在 2010-1-14,10:15, Elliott Slaughter 写道:
One more request:
Is there any way of having a timeout on socket-receive? Or at least have some way of checking whether there is any data waiting (so I don't have to block while waiting for packets to arrive)?
Yes, there're two ways: 1) When creating the UDP socket using SOCKET-CONNECT, you can set the keyword argument TIMEOUT, and SOCKET-RECEIVE will return in that seconds when there's no data received. 2) You can use WAIT-FOR-INPUT, the same way as TCP usockets. --binghe