# Path: ogn/client/settings.py
# APRS_SERVER_HOST = 'aprs.glidernet.org'
# APRS_SERVER_PORT_FULL_FEED = 10152
# APRS_SERVER_PORT_CLIENT_DEFINED_FILTERS = 14580
# APRS_APP_NAME = 'python-ogn-client'
# PACKAGE_VERSION = '1.2.1'
# APRS_APP_VER = PACKAGE_VERSION[:3]
# APRS_KEEPALIVE_TIME = 240
# TELNET_SERVER_HOST = 'localhost'
# TELNET_SERVER_PORT = 50001


import socket
import logging
from time import time, sleep
from ogn.client import settings
                    self.logger.info('Waiting {}s before next connection try ({} attempts left).'.format(wait_period, retries))
                    sleep(wait_period)
                else:
                    self._kill = True
                    self.logger.critical('Could not connect to OGN.')

    def disconnect(self):
        self.logger.info('Disconnect from {}'.format(self._sock_peer_ip))
        try:
            # close everything
            self.sock.shutdown(0)
            self.sock.close()
        except OSError:
            self.logger.error('Socket close error')

        self._kill = True

    def run(self, callback, timed_callback=lambda client: None, autoreconnect=False, ignore_decoding_error=True,
            **kwargs):
        while not self._kill:
            try:
                keepalive_time = time()
                while not self._kill:
                    if time() - keepalive_time > self.settings.APRS_KEEPALIVE_TIME:
                        self.logger.info('Send keepalive to {}'.format(self._sock_peer_ip))
                        self.sock.send('#keepalive\n'.encode())
                        timed_callback(self)
                        keepalive_time = time()

                    # Read packet string from socket

# Path: ogn/client/settings.py
# APRS_SERVER_HOST = 'aprs.glidernet.org'
# APRS_SERVER_PORT_FULL_FEED = 10152
# APRS_SERVER_PORT_CLIENT_DEFINED_FILTERS = 14580
# APRS_APP_NAME = 'python-ogn-client'
# PACKAGE_VERSION = '1.2.1'
# APRS_APP_VER = PACKAGE_VERSION[:3]
# APRS_KEEPALIVE_TIME = 240
# TELNET_SERVER_HOST = 'localhost'
# TELNET_SERVER_PORT = 50001


# Path: ogn/client/client.py
import socket
import logging
from time import time, sleep
from ogn.client import settings

                    self.logger.info('Waiting {}s before next connection try ({} attempts left).'.format(wait_period, retries))
                    sleep(wait_period)
                else:
                    self._kill = True
                    self.logger.critical('Could not connect to OGN.')

    def disconnect(self):
        self.logger.info('Disconnect from {}'.format(self._sock_peer_ip))
        try:
            # close everything
            self.sock.shutdown(0)
            self.sock.close()
        except OSError:
            self.logger.error('Socket close error')

        self._kill = True

    def run(self, callback, timed_callback=lambda client: None, autoreconnect=False, ignore_decoding_error=True,
            **kwargs):
        while not self._kill:
            try:
                keepalive_time = time()
                while not self._kill:
                    if time() - keepalive_time > self.settings.APRS_KEEPALIVE_TIME:
                        self.logger.info('Send keepalive to {}'.format(self._sock_peer_ip))
                        self.sock.send('#keepalive\n'.encode())
                        timed_callback(self)
                        keepalive_time = time()

                    # Read packet string from socket

                    packet_b = self.sock_file.readline().strip()