# Path: ejtp/jacks/stream.py
# class StreamJack(jack.Jack):
# class Connection(object):
#     def __init__(self, router, interface):
#     def label(self, interface):
#     def create_connection(self, interface):
#     def add_connection(self, interface, conn=None):
#     def get_connection(self, interface):
#     def route(self, frame):
#     def __init__(self, jack=None):
#     def _send(self, frame):
#     def _recv(self):
#     def run(self):
#     def start(self):
#     def close(self):
#     def send(self, frame):
#     def recv(self, timeout=0):
#     def wrap(self, frame):
#     def inject(self, newdata):


import socket
import logging
from persei import RawDataDecorator
from ejtp.jacks import stream
and/or modify it under the terms of the GNU Lesser Public License as
published by the Free Software Foundation, either version 3 of the 
License, or (at your option) any later version.

the Python EJTP library is distributed in the hope that it will be 
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.

You should have received a copy of the GNU Lesser Public License
along with the Python EJTP library.  If not, see 
<http://www.gnu.org/licenses/>.
'''

logger = logging.getLogger(__name__)



class TCPJack(stream.StreamJack):

    def __init__(self, router, host='::', port=3972, ipv=6):
        if ipv==6:
            ifacetype = "tcp"
            self.address = (host, port, 0, 0)
            self.sockfamily = socket.AF_INET6
        else: 
            ifacetype = "tcp4"
            self.address = (host, port)
            self.sockfamily = socket.AF_INET


# Path: ejtp/jacks/stream.py
# class StreamJack(jack.Jack):
# class Connection(object):
#     def __init__(self, router, interface):
#     def label(self, interface):
#     def create_connection(self, interface):
#     def add_connection(self, interface, conn=None):
#     def get_connection(self, interface):
#     def route(self, frame):
#     def __init__(self, jack=None):
#     def _send(self, frame):
#     def _recv(self):
#     def run(self):
#     def start(self):
#     def close(self):
#     def send(self, frame):
#     def recv(self, timeout=0):
#     def wrap(self, frame):
#     def inject(self, newdata):


# Path: ejtp/jacks/tcp.py
import socket
import logging
from persei import RawDataDecorator
from ejtp.jacks import stream

and/or modify it under the terms of the GNU Lesser Public License as
published by the Free Software Foundation, either version 3 of the 
License, or (at your option) any later version.

the Python EJTP library is distributed in the hope that it will be 
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.

You should have received a copy of the GNU Lesser Public License
along with the Python EJTP library.  If not, see 
<http://www.gnu.org/licenses/>.
'''

logger = logging.getLogger(__name__)



class TCPJack(stream.StreamJack):

    def __init__(self, router, host='::', port=3972, ipv=6):
        if ipv==6:
            ifacetype = "tcp"
            self.address = (host, port, 0, 0)
            self.sockfamily = socket.AF_INET6
        else: 
            ifacetype = "tcp4"
            self.address = (host, port)
            self.sockfamily = socket.AF_INET


        stream.StreamJack.__init__(self, router, (ifacetype, (host, port)))