# Path: collectors/lib/utils.py
# PY3 = sys.version_info[0] > 2
# USER = "nobody"
# def drop_privileges(user=USER):
# def is_sockfile(path):
# def err(msg):
#     def is_numeric(value):
#     def is_numeric(value):


import socket
import os
import sys
import time
from collectors.lib import utils
    from _thread import *
    from thread import *
    from collectors.etc import tcp_bridge_conf
        else:
            return line

    try:
        if tcp_bridge_conf.port():
            PORT = tcp_bridge_conf.port()

        if tcp_bridge_conf.host():
            HOST = tcp_bridge_conf.host()

        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.bind((HOST, PORT))
        sock.listen(1)

    except socket.error as msg:
        utils.err('could not open socket: %s' % msg)
        sys.exit(1)

    try:
        flush_delay = tcp_bridge_conf.flush_delay()
    except AttributeError:
        flush_delay = 60

    try:
        try:
            while 1:
                connection, address = sock.accept()
                start_new_thread(clientthread, (connection,))

        except KeyboardInterrupt:

# Path: collectors/lib/utils.py
# PY3 = sys.version_info[0] > 2
# USER = "nobody"
# def drop_privileges(user=USER):
# def is_sockfile(path):
# def err(msg):
#     def is_numeric(value):
#     def is_numeric(value):


# Path: collectors/0/tcp_bridge.py
import socket
import os
import sys
import time
from collectors.lib import utils
    from _thread import *
    from thread import *
    from collectors.etc import tcp_bridge_conf

        else:
            return line

    try:
        if tcp_bridge_conf.port():
            PORT = tcp_bridge_conf.port()

        if tcp_bridge_conf.host():
            HOST = tcp_bridge_conf.host()

        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.bind((HOST, PORT))
        sock.listen(1)

    except socket.error as msg:
        utils.err('could not open socket: %s' % msg)
        sys.exit(1)

    try:
        flush_delay = tcp_bridge_conf.flush_delay()
    except AttributeError:
        flush_delay = 60

    try:
        try:
            while 1:
                connection, address = sock.accept()
                start_new_thread(clientthread, (connection,))

        except KeyboardInterrupt:

            utils.err("keyboard interrupt, exiting")