# Path: concert/quantities.py

# 
# Path: concert/config.py
# AIODEBUG = 9


import asyncio
import os
import logging
    import IPython
    import PyTango
from concert.quantities import q
from concert.config import AIODEBUG
        from IPython.core.async_helpers import get_asyncio_loop
"""Connection protocols for network communication."""


LOG = logging.getLogger(__name__)


class SocketConnection(object):

    """A two-way socket connection. *return_sequence* is a string appended
    after every command indicating the end of it, the default value
    is a newline (\\n).
    """

    def __init__(self, host, port, return_sequence="\n"):
        self._peer = (host, port)
        self._reader = None
        self._writer = None
        self.lock = asyncio.Lock()
        self.return_sequence = return_sequence

    async def __aenter__(self):
        LOG.log(AIODEBUG, 'Socket connection enter')
        await self.connect()

        return self

    async def __aexit__(self, exc_type, exc, tb):

# Path: concert/quantities.py

# 
# Path: concert/config.py
# AIODEBUG = 9


# Path: concert/networking/base.py
import asyncio
import os
import logging
    import IPython
    import PyTango
from concert.quantities import q
from concert.config import AIODEBUG
        from IPython.core.async_helpers import get_asyncio_loop

"""Connection protocols for network communication."""


LOG = logging.getLogger(__name__)


class SocketConnection(object):

    """A two-way socket connection. *return_sequence* is a string appended
    after every command indicating the end of it, the default value
    is a newline (\\n).
    """

    def __init__(self, host, port, return_sequence="\n"):
        self._peer = (host, port)
        self._reader = None
        self._writer = None
        self.lock = asyncio.Lock()
        self.return_sequence = return_sequence

    async def __aenter__(self):
        LOG.log(AIODEBUG, 'Socket connection enter')
        await self.connect()

        return self

    async def __aexit__(self, exc_type, exc, tb):

        LOG.log(AIODEBUG, 'Socket connection exit')