def __init__(self, serial, timeout_ms=None):
        """Initialize the TCP Handle.
        Arguments:
          serial: Android device serial of the form host or host:port.

        Host may be an IP address or a host name.
        """
        # if necessary, convert serial to a unicode string
        if isinstance(serial, (bytes, bytearray)):
            serial = serial.decode('utf-8')

        if ':' in serial:
            self.host, self.port = serial.split(':')
        else:
            self.host = serial
            self.port = 5555

        self._connection = None
        self._serial_number = '%s:%s' % (self.host, self.port)
        self._timeout_ms = float(timeout_ms) if timeout_ms else None

        self._connect()
Initialize the TCP Handle.
        Arguments:
          serial: Android device serial of the form host or host:port.

        Host may be an IP address or a host name.
        
adb/common.py