Dear Stephen,
Thanks for telling me this all looked very peculiar. As you said, it did not
really need solving.
Cheers,
Dwayne
2011/2/4 Stephen Hansen
> On 2/4/11 9:16 AM, Dwayne Blind wrote:
> > @ Stephen Hansen
> > Now I am pretty much worried. :'(
>
> Why? T
Thank you very much Jean-Michel Pichavant and Stephen Hansen.
@ Jean-Michel Pichavant
I will have a look at Pyro.
@ Stephen Hansen
Now I am pretty much worried. :'(
2011/2/4 Stephen Hansen
> On 2/4/11 6:55 AM, Dwayne Blind wrote:
> > @ Jean-Michel Pichavant
> >
Hansen
Each player can send as many words as he wants. I think this is why I need
the loop. Don't you think so ?
@ Dave Angel
s = conn, with conn,address=socket.accept()
(see Socket Objects)
Thanks again
2011/2/4 Jean-Michel Pichavant
> Stephen Hansen wrote:
>
>> On 2/3/11 9:56
2/4 Dwayne Blind
> The solution would be
>
>
> timeout = s.gettimeout()
> s.settimeout(3)
> b=time.clock()
> while time.clock()-b<3 :
>try :
>data=s.recv(1024)
> except :
>break
>
The solution would be
timeout = s.gettimeout()
s.settimeout(3)
b=time.clock()
while time.clock()-b<3 :
try :
data=s.recv(1024)
except :
break
s.settimeout(timeout)
Am I right ?
Dwayne
2011/2/4 Dwayne Blind
>
Stephen Hansen
> On 2/3/11 10:13 AM, Dwayne Blind wrote:
> > Thanks for your answer. I don't want to reset my socket. I want to apply
> > the timeout to the rcv method only.
>
> Setting the timeout does not "reset [your] socket", I don't think. And I
> ge
Thanks for your answer. I don't want to reset my socket. I want to apply the
timeout to the rcv method only.
What about select ?
http://docs.python.org/library/select.html#select.select
How to implement it ?
Thanks a lot,
Dwayne
2011/2/3 Stephen Hansen
> On 2/3/11 9:56 AM, Dway
Hi everybody,
I am using Python 3.0.
I have such a code :
b=time.clock()
while time.clock()-b<3 :
data=s.recv(1024)
However I would like to set timeout on the socket rcv method, so that the
while loop stops exactly after 3 seconds. Is this possible ?
Thanks a lot,
Dwayne
--
http://mail.pyt