Skip to content

Blocking=False in consumer causes errors #57

Description

@hemna

I am trying to create a threaded app that can stop each thread upon CTRL-C, and would like to set a timeout on consumer select.select to check if the app should quit or not. When I set blocking=False in consumer setup, I get nothing but resource not available errors.

Source:

I edited the source to not include my callsign and password

import aprslib
import logging

def callback(packet):
    try:
        packet = aprslib.parse(packet)
        print(packet)
    except (aprslib.ParseError, aprslib.UnknownFormat) as exp:
        pass

logging.basicConfig(level=logging.INFO) # level=10

AIS = aprslib.IS("<MY ACCOUNT HERE>", passwd="<MY PASSWORD HERE>", port=14580, host="rotate.aprs2.net")
AIS.connect()
AIS.consumer(callback, raw=True, blocking=False, immortal=True)

The output

INFO:aprslib.inet.IS:Attempting connection to rotate.aprs2.net:14580
INFO:aprslib.inet.IS:Connected to ('62.77.224.245', 14580)
INFO:aprslib.inet.IS:Sending login information
INFO:aprslib.inet.IS:Login successful
ERROR:aprslib.inet.IS:socket error on recv(): [Errno 11] Resource temporarily unavailable

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions