Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Asyncio select.select
#3
Here is what I have - but this still doesn't make sense really...

def ssl_read_select(rlist, timeout):
    return [
        conn for conn in rlist
        if isinstance(conn, SSL.Connection) and conn.pending() > 0
    ] or await wait_for_socket(rlist)


def reader():
    data = conn.recv(100)
    # We are done: unregister the file descriptor
    loop.remove_reader(rsock)
    # Stop the event loop
    loop.stop()

def wait_for_socket(rlist):
   loop = asyncio.ProactorEventLoop()
   for conn in rlist:
       loop.add_reader(conn, reader)
   loop.run_forever()
   loop.close()
But then again I don't think this would work (even if I did get it to work) because my understanind this loop type doesn't support add_reader base off the documents.

https://docs.python.org/3/library/asynci...loops.html
ProactorEventLoop specific limits:

create_datagram_endpoint() (UDP) is not supported
add_reader() and add_writer() are not supported

Here is what I have - but this still doesn't make sense really... = Just trying to get the idea to work I know the following code will not work of course.

So I can't edit my post? This seems a bit silly to me?
Reply


Messages In This Thread
Asyncio select.select - by Mradr - Aug-12-2018, 08:46 AM
RE: Asyncio select.select - by Larz60+ - Aug-12-2018, 10:48 AM
RE: Asyncio select.select - by Mradr - Aug-12-2018, 01:42 PM
RE: Asyncio select.select - by Larz60+ - Aug-12-2018, 02:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Select of connections Gupi 1 2,107 Jun-04-2019, 09:32 AM
Last Post: Gupi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020