# Path: pyDAPLink/socket/socket.py
# class Connection(object):
#     def send(self, data):
#         return
# 
#     def recv(self, size=2**16):
#         return
# 
#     def settimeout(self, timeout):
#         return
# 
#     def isalive(self):
#         return
# 
#     def shutdown(self):
#         return
# 
#     def close(self):
#         return
# 
# class Server(object):
#     def __init__(self, address=None, timeout=None):
#         self.address = address
#     
#     def open(self):
#         return
# 
#     def accept(self):
#         return
# 
#     def settimeout(self):
#         return
# 
#     def isalive(self):
#         return
# 
#     def shutdown(self):
#         return
# 
#     def close(self):
#         return
# 
# class Client(Connection):
#     def __init__(self, address=None, timeout=None):
#         self.address = address
# 
#     def open(self):
#         return
# 
# class Socket(object):
#     name = None
#     available = False
# 
#     @staticmethod
#     def addrisvalid(address):
#         return False
# 
#     Client = Client
#     Server = Server
# 
# Path: pyDAPLink/utility/socket_pair.py
# def socket_pair():
#     if hasattr(socket, 'socketpair'):
#         return socket.socketpair()
# 
#     server = socket.socket()
#     server.bind(('localhost', 0))
#     server.listen(1)
# 
#     a = socket.socket()
#     a.setblocking(False)
# 
#     try:
#         a.connect(server.getsockname())
#     except socket.error as err:
#         if err.errno not in (errno.EWOULDBLOCK, errno.EINPROGRESS):
#             raise
#     
#     b, _ = server.accept()
# 
#     return a, b


import os
import stat
import socket
from select import select
from .socket import Connection, Server, Client, Socket
from ..utility import socket_pair
"""
 mbed CMSIS-DAP debugger
 Copyright (c) 2006-2013 ARM Limited

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
"""

# Needed for importing both socket and .socket
from __future__ import absolute_import




# Path: pyDAPLink/socket/socket.py
# class Connection(object):
#     def send(self, data):
#         return
# 
#     def recv(self, size=2**16):
#         return
# 
#     def settimeout(self, timeout):
#         return
# 
#     def isalive(self):
#         return
# 
#     def shutdown(self):
#         return
# 
#     def close(self):
#         return
# 
# class Server(object):
#     def __init__(self, address=None, timeout=None):
#         self.address = address
#     
#     def open(self):
#         return
# 
#     def accept(self):
#         return
# 
#     def settimeout(self):
#         return
# 
#     def isalive(self):
#         return
# 
#     def shutdown(self):
#         return
# 
#     def close(self):
#         return
# 
# class Client(Connection):
#     def __init__(self, address=None, timeout=None):
#         self.address = address
# 
#     def open(self):
#         return
# 
# class Socket(object):
#     name = None
#     available = False
# 
#     @staticmethod
#     def addrisvalid(address):
#         return False
# 
#     Client = Client
#     Server = Server
# 
# Path: pyDAPLink/utility/socket_pair.py
# def socket_pair():
#     if hasattr(socket, 'socketpair'):
#         return socket.socketpair()
# 
#     server = socket.socket()
#     server.bind(('localhost', 0))
#     server.listen(1)
# 
#     a = socket.socket()
#     a.setblocking(False)
# 
#     try:
#         a.connect(server.getsockname())
#     except socket.error as err:
#         if err.errno not in (errno.EWOULDBLOCK, errno.EINPROGRESS):
#             raise
#     
#     b, _ = server.accept()
# 
#     return a, b


# Path: pyDAPLink/socket/unix_socket.py
import os
import stat
import socket
from select import select
from .socket import Connection, Server, Client, Socket
from ..utility import socket_pair

"""
 mbed CMSIS-DAP debugger
 Copyright (c) 2006-2013 ARM Limited

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
"""

# Needed for importing both socket and .socket
from __future__ import absolute_import




class UnixConnection(Connection):