def _read(self, length):
        """Reads length bytes from connection. In case we catch any exception,
        prepends remote address to the exception message and raise again.

        Raises:
            ConnectionTerminatedException: when read returns empty string.
        """

        try:
            read_bytes = self._request.connection.read(length)
            if not read_bytes:
                raise ConnectionTerminatedException(
                    'Receiving %d byte failed. Peer (%r) closed connection' %
                    (length, (self._request.connection.remote_addr,)))
            return read_bytes
        except socket.error, e:
            # Catch a socket.error. Because it's not a child class of the
            # IOError prior to Python 2.6, we cannot omit this except clause.
            # Use %s rather than %r for the exception to use human friendly
            # format.
            raise ConnectionTerminatedException(
                'Receiving %d byte failed. socket.error (%s) occurred' %
                (length, e))
        except __HOLE__, e:
            # Also catch an IOError because mod_python throws it.
            raise ConnectionTerminatedException(
                'Receiving %d byte failed. IOError (%s) occurred' %
                (length, e))
dataset/ETHPy150Open google/pywebsocket/mod_pywebsocket/_stream_base.py/StreamBase._read