ur/ur_communicator.py
def make_connection(host, port, disable_nagle_algorithm):
        """Establishes a TCP/IP socket connection with a UR5 controller.

        Args:
            host: a string specifying UR5 Controller IP address
            port: a string specifying UR5 Controller port
            disable_nagle_algorithm: a boolean specifying whether to
                disable nagle algorithm

        Returns:
             None or TCP socket connected to UR5 device.
        """
        sock = None
        for res in socket.getaddrinfo(host,
                                      port,
                                      socket.AF_UNSPEC,
                                      socket.SOCK_STREAM):
            afam, socktype, proto, canonname, sock_addr = res
            del canonname
            try:
                sock = socket.socket(afam, socktype, proto)
                if disable_nagle_algorithm:
                    sock.setsockopt(socket.IPPROTO_TCP,
                                    socket.TCP_NODELAY, True)
            except OSError as msg:
                logging.debug(msg)
                sock = None
                continue
            try:
                sock.connect(sock_addr)
            except OSError as msg:
                logging.debug(msg)
                sock.close()
                sock = None
                continue
            break
        return sock
Establishes a TCP/IP socket connection with a UR5 controller.

        Args:
            host: a string specifying UR5 Controller IP address
            port: a string specifying UR5 Controller port
            disable_nagle_algorithm: a boolean specifying whether to
                disable nagle algorithm

        Returns:
             None or TCP socket connected to UR5 device.
        
Establishes a TCP/IP socket connection with a UR5 controller.
Establishes a TCP / IP socket connection with a UR5 controller .
def make_connection(host, port, disable_nagle_algorithm):
        sock = None
        for res in socket.getaddrinfo(host,
                                      port,
                                      socket.AF_UNSPEC,
                                      socket.SOCK_STREAM):
            afam, socktype, proto, canonname, sock_addr = res
            del canonname
            try:
                sock = socket.socket(afam, socktype, proto)
                if disable_nagle_algorithm:
                    sock.setsockopt(socket.IPPROTO_TCP,
                                    socket.TCP_NODELAY, True)
            except OSError as msg:
                logging.debug(msg)
                sock = None
                continue
            try:
                sock.connect(sock_addr)
            except OSError as msg:
                logging.debug(msg)
                sock.close()
                sock = None
                continue
            break
        return sock
def make_connection ( host , port , disable_nagle_algorithm ) : sock = None for res in socket . getaddrinfo ( host , port , socket . AF_UNSPEC , socket . SOCK_STREAM ) : afam , socktype , proto , canonname , sock_addr = res del canonname try : sock = socket . socket ( afam , socktype , proto ) if disable_nagle_algorithm : sock . setsockopt ( socket . IPPROTO_TCP , socket . TCP_NODELAY , True ) except OSError as msg : logging . debug ( msg ) sock = None continue try : sock . connect ( sock_addr ) except OSError as msg : logging . debug ( msg ) sock . close ( ) sock = None continue break return sock
Establishes a TCP/IP socket connection with a UR5 controller.
Establishes a TCP / IP socket connection with a UR5 controller .
"""Establishes a TCP/IP socket connection with a UR5 controller.

        Args:
            host: a string specifying UR5 Controller IP address
            port: a string specifying UR5 Controller port
            disable_nagle_algorithm: a boolean specifying whether to
                disable nagle algorithm

        Returns:
             None or TCP socket connected to UR5 device.
        """
None or TCP socket connected to UR5 device.
None or TCP socket connected to UR5 device .
host
a string specifying UR5 Controller IP address
a string specifying UR5 Controller IP address
port
a string specifying UR5 Controller port
a string specifying UR5 Controller port
disable_nagle_algorithm
a boolean specifying whether to
disable nagle algorithm
a boolean specifying whether to disable nagle algorithm