Skip to content

How to get a stream to await for incoming data on a socket #638

Answered by ejm4567
ejm4567 asked this question in Q&A
Discussion options

You must be logged in to vote

OK, I've resolved the issue of the Segmentation fault. The Segmentation fault was due to a bug in the legacy C code where the requests to the Python script originate. Fixing the bug in the legacy C code then allowed the Python script to run continuously when the socket is readable, and wait for an indefinite period (which can vary from a few seconds, to up to 10 mins) as the legacy codebase works in it's caching DB and queues.

For the record, here's the key snippet of AnyIO code that works with the legacy C code driver:

from anyio import (
        TASK_STATUS_IGNORED,
        create_task_group,
        connect_tcp,
        create_tcp_listener,
        wait_socket_readable,
        run,
  …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@ejm4567
Comment options

@ejm4567
Comment options

@agronholm
Comment options

Comment options

You must be logged in to vote
2 replies
@agronholm
Comment options

@agronholm
Comment options

Answer selected by ejm4567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants