def METHOD_NAME(self, transport):
    """Device connection was made."""
    _LOGGER.debug("Connection made to device")
    self._transport = transport
    sock = transport.get_extra_info("socket")
    try:
        tcp_keepalive(sock)
    except exceptions.NotSupportedError as ex:
        _LOGGER.warning("Keep-alive not supported: %s", str(ex))
    dstaddr, dstport = sock.getpeername()
    srcaddr, srcport = sock.getsockname()
    self._log_str = f"{srcaddr}:{srcport}<->{dstaddr}:{dstport} "
    _LOGGER.debug("%s Connection established", self._log_str)