def listen(self, socket, backlog):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if (not isinstance(socket, DataLinkConnection)):
        raise Error(errno.EOPNOTSUPP)
    if (not (type(backlog) == IntType)):
        raise TypeError('backlog must be integer')
    if (backlog < 0):
        raise ValueError('backlog mmust not be negative')
    backlog = min(backlog, 16)
    if (not socket.is_bound):
        self.bind(socket)
    socket.listen(backlog)
def listen(self, socket, backlog):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if (not isinstance(socket, DataLinkConnection)):
        raise Error(errno.EOPNOTSUPP)
    if (not (type(backlog) == IntType)):
        raise TypeError('backlog must be integer')
    if (backlog < 0):
        raise ValueError('backlog mmust not be negative')
    backlog = min(backlog, 16)
    if (not socket.is_bound):
        self.bind(socket)
    socket.listen(backlog)