# Path: ejtp/jacks/core.py
# class Jack(object):
#     def __init__(self, router, interface):
#     def run(self):
#     def close(self):
#     def route(self, msg):
#     def recv(self, data):
#     def run_threaded(self):
#     def ifacetype(self):
# def make(router, iface):


from persei import RawData, RawDataDecorator
from ejtp.jacks import core as jack
import threading
    import Queue
    import queue as Queue
        Create a connection, add it to self.connections, and return it.
        '''
        if conn==None:
            conn = self.create_connection(interface)
        label = self.label(interface)
        self.connections[label] = conn
        return conn

    def get_connection(self, interface):
        '''
        Retrieve or create a connection as necessary.
        '''
        label = self.label(interface)
        if label in self.connections:
            return self.connections[label]
        else:
            return self.add_connection(interface)

    def route(self, frame):
        '''
        Send frame to somewhere.
        '''
        conn = self.get_connection(frame.address)
        conn.send(frame)

class Connection(object):
    '''
    Represents a persistent connection to a remote host. Should be subclassed.
    '''
    def __init__(self, jack=None):

# Path: ejtp/jacks/core.py
# class Jack(object):
#     def __init__(self, router, interface):
#     def run(self):
#     def close(self):
#     def route(self, msg):
#     def recv(self, data):
#     def run_threaded(self):
#     def ifacetype(self):
# def make(router, iface):


# Path: ejtp/jacks/stream.py
from persei import RawData, RawDataDecorator
from ejtp.jacks import core as jack
import threading
    import Queue
    import queue as Queue

        Create a connection, add it to self.connections, and return it.
        '''
        if conn==None:
            conn = self.create_connection(interface)
        label = self.label(interface)
        self.connections[label] = conn
        return conn

    def get_connection(self, interface):
        '''
        Retrieve or create a connection as necessary.
        '''
        label = self.label(interface)
        if label in self.connections:
            return self.connections[label]
        else:
            return self.add_connection(interface)

    def route(self, frame):
        '''
        Send frame to somewhere.
        '''
        conn = self.get_connection(frame.address)
        conn.send(frame)

class Connection(object):
    '''
    Represents a persistent connection to a remote host. Should be subclassed.
    '''
    def __init__(self, jack=None):

        self.jack = jack