def __init__(self, family, address, target):
self._socket = None<EOL>self._lock = threading.RLock()<EOL>self._target = target<EOL>sock = socket.socket(family, socket.SOCK_STREAM)<EOL>try:<EOL><INDENT>sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, <NUM_LIT:1>)<EOL>sock.bind(address)<EOL><DEDENT>except:<EOL><INDENT>sock.close()<EOL>raise<EOL><DEDENT>self._socket = sock<EOL>
Initialize the `TCPListener` object and create the socket.

        :Parameters:
            - `family`: address family (:std:`socket.AF_INET` or
              :std:`socket.AF_INET6`)
            - `address`: address to listen on (address, port)
            - `target`: function to call on an accepted connection