Check if socket is readable/writable.

def _check_socket(self, timeout=None):
        """Check if socket is readable/writable."""
        sock = self.sock
        available_socks = select.select([sock], [sock], [sock], timeout)
        if available_socks[2]:
            raise OSError
        return available_socks