import socket
import logging


def listen(address):
    """ Set up and return a TCP server object """
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    s.bind(address)
    s.listen(1)
    logging.info('Bound to address %s', address)
    return s