"James Harris" wrote in message
news:msv21t$n1m$1...@dont-email.me...
"Grant Edwards" wrote in message
news:msum6c$hv$1...@reader1.panix.com...
...
Waking up twice per second and immediately
calling select() again on any hardware/OS built in the past 50 years
is going completely negligi
"Grant Edwards" wrote in message
news:msum6c$hv$1...@reader1.panix.com...
On 2015-09-11, Chris Angelico wrote:
This is what I meant when I said you would be polling. Effectively,
you wake up your program every half-second, check if Ctrl-C has been
pressed, and if it hasn't, you go back to s
On Fri, Sep 11, 2015 at 11:50 PM, Grant Edwards wrote:
> On 2015-09-11, Chris Angelico wrote:
>
>> This is what I meant when I said you would be polling. Effectively,
>> you wake up your program every half-second, check if Ctrl-C has been
>> pressed, and if it hasn't, you go back to sleep again.
Grant Edwards :
> On 2015-09-11, Chris Angelico wrote:
>> This is what I meant when I said you would be polling. Effectively,
>> you wake up your program every half-second, check if Ctrl-C has been
>> pressed, and if it hasn't, you go back to sleep again. This is pretty
>> inefficient.
>
> Though
On 2015-09-11, Chris Angelico wrote:
> This is what I meant when I said you would be polling. Effectively,
> you wake up your program every half-second, check if Ctrl-C has been
> pressed, and if it hasn't, you go back to sleep again. This is pretty
> inefficient.
Though it offends one's enginee
On Fri, Sep 11, 2015 at 6:12 AM, James Harris wrote:
> Thanks for your help, Chris. Using select() is a very good option. I tried
> first without a timeout and even then this version of Windows does not
> recognise Control-C until after the select() call returns (which needs
> similar prompting as
"Chris Angelico" wrote in message
news:mailman.337.1441913195.8327.python-l...@python.org...
On Fri, Sep 11, 2015 at 5:11 AM, James Harris
wrote:
...
However, on Windows the recognition of Control-C does not happen
until after
something connects to the socket.
...
This is a known pro
On Fri, Sep 11, 2015 at 5:11 AM, James Harris wrote:
> S:\>python socktest.py
> Traceback (most recent call last):
> File "socktest.py", line 6, in
>endpoint = s.accept()
> File "C:\Python27\lib\socket.py", line 202, in accept
>sock, addr = self._sock.accept()
> KeyboardInterrupt
>
> S:
"Chris Angelico" wrote in message
news:mailman.332.1441910212.8327.python-l...@python.org...
On Fri, Sep 11, 2015 at 4:24 AM, James Harris
wrote:
I have a listening socket, self.lsock, which is used in an accept()
call as
follows
endpoint = self.lsock.accept()
The problem is that if cont
On Fri, Sep 11, 2015 at 4:24 AM, James Harris wrote:
> I have a listening socket, self.lsock, which is used in an accept() call as
> follows
>
> endpoint = self.lsock.accept()
>
> The problem is that if control-C is pressed it is not recognised until
> something connects to that socket. Only when
I have a listening socket, self.lsock, which is used in an accept() call
as follows
endpoint = self.lsock.accept()
The problem is that if control-C is pressed it is not recognised until
something connects to that socket. Only when the accept() call returns
is the signal seen.
The question,
11 matches
Mail list logo