

def get_socket(self):
    '\n        Return a connected socket.\n\n        Note: connect the socket before assigning it to the class instance to\n        avoid bad thread race conditions.\n        '
    if (not self.socket):
        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        sock.connect((self.host, self.port))
        self.socket = sock
    return self.socket

dataset/ETHPy150Open DataDog/datadogpy/datadog/dogstatsd/base.py DogStatsd.get_socket/original