Terry Reedy wrote:
> I suggest you post your minimal example there. User interest in an
> issue being fixed and willingness to test patches can help motivate.
I've done it. Thank you for help.
--
https://mail.python.org/mailman/listinfo/python-list
On 7/4/2015 3:04 AM, Adam Bartoš wrote:
This is a minimal example:
import asyncio
async def wait():
await asyncio.sleep(5)
loop = asyncio.get_event_loop()
loop.run_until_complete(wait())
Ctrl-C doesn't interrupt the waiting, instead KeyboardInterrupt occurs
after those five seconds. It'
On Sat, Jul 4, 2015 at 1:07 PM, Adam Bartoš wrote:
> On Fri, Jul 3, 2015 at 9:14 AM, Marko Rauhamaa
>> wrote:
>> >
>> >>> 1) is there a way to close just one direction of the connection?
>> >>
>> >> No. SOCK_STREAM sockets are always bidirectional.
>> >
>> > socket.shutdown(socket.SHUT_WR) does
>
> On Fri, Jul 3, 2015 at 9:14 AM, Marko Rauhamaa
> wrote:
> >
> >>> 1) is there a way to close just one direction of the connection?
> >>
> >> No. SOCK_STREAM sockets are always bidirectional.
> >
> > socket.shutdown(socket.SHUT_WR) does the trick.
> >
> > I think the asyncio.StreamWriter.write_
On Sat, Jul 4, 2015 at 8:45 AM, Adam Bartoš wrote:
> On Fri, Jul 3, 2015 at 7:38 PM, Adam Bartoš wrote:
>>>
Ian Kelly:
>>> >> 2) In the blocked situaction even KeyboardInterrupt doesn't break the
loop
>>> >> is that desired behavior? And why?
>>> >
>>> > I don't thi
>
> On Fri, Jul 3, 2015 at 7:38 PM, Adam Bartoš wrote:
>>
>>> Ian Kelly:
>>>
>> >> 2) In the blocked situaction even KeyboardInterrupt doesn't break the
>>> loop
>>>
>> >> is that desired behavior? And why?
>>>
>> >
>>>
>> > I don't think so. When I tried this locally (using Python 3.4.0, so
>>>
>
On Fri, Jul 3, 2015 at 9:14 AM, Marko Rauhamaa wrote:
>
>>> 1) is there a way to close just one direction of the connection?
>>
>> No. SOCK_STREAM sockets are always bidirectional.
>
> socket.shutdown(socket.SHUT_WR) does the trick.
>
> I think the asyncio.StreamWriter.write_eof() is the high-leve
On 7/3/2015 4:33 PM, Adam Bartoš wrote:
On Fri, Jul 3, 2015 at 7:38 PM, Adam Bartoš mailto:dre...@gmail.com>> wrote:
Ian Kelly:
>> 2) In the blocked situaction even KeyboardInterrupt doesn't break the
loop,
>> is that desired behavior? And why?
>
> I don't think so. When
On Fri, Jul 3, 2015 at 7:38 PM, Adam Bartoš wrote:
> Ian Kelly:
>
> >> 2) In the blocked situaction even KeyboardInterrupt doesn't break the
> loop,
> >> is that desired behavior? And why?
> >
> > I don't think so. When I tried this locally (using Python 3.4.0, so
> > replacing "async def" with "
>> Marko Rauhamaa:
>>> socket.shutdown(socket.SHUT_WR) does the trick.
>>>
>>> I think the asyncio.StreamWriter.write_eof() is the high-level
>>> equivalent.
>>
>> You are right that writer.write_eof() behaves like
>> writer.transport.get_extra_info("socket").shutdown(socket.SHUT_WR) –
>> the serve
Adam Bartoš :
> Marko Rauhamaa:
>> socket.shutdown(socket.SHUT_WR) does the trick.
>>
>> I think the asyncio.StreamWriter.write_eof() is the high-level
>> equivalent.
>
> You are right that writer.write_eof() behaves like
> writer.transport.get_extra_info("socket").shutdown(socket.SHUT_WR) –
> the
Ian Kelly:
>> 2) In the blocked situaction even KeyboardInterrupt doesn't break the
loop,
>> is that desired behavior? And why?
>
> I don't think so. When I tried this locally (using Python 3.4.0, so
> replacing "async def" with "def" and "await" with "yield from" and
> "loop.create_task" with "as
>> 1) is there a way to close just one direction of the connection?
>
> No. SOCK_STREAM sockets are always bidirectional.
socket.shutdown(socket.SHUT_WR) does the trick.
I think the asyncio.StreamWriter.write_eof() is the high-level
equivalent.
Marko
--
https://mail.python.org/mailman/listinf
On Fri, Jul 3, 2015 at 8:31 AM, Ian Kelly wrote:
> On Fri, Jul 3, 2015 at 4:28 AM, Adam Bartoš wrote:
>> Hello,
>>
>> I'm experimenting with asyncio. I have composed the following code. There is
>> a server handler and a client handler. I didn't want to split the code into
>> two files so I just
On Fri, Jul 3, 2015 at 4:28 AM, Adam Bartoš wrote:
> Hello,
>
> I'm experimenting with asyncio. I have composed the following code. There is
> a server handler and a client handler. I didn't want to split the code into
> two files so I just used a socketpair, inspired by example
> https://docs.pyt
15 matches
Mail list logo