def close(self, socket):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if socket.is_bound:
        self.sap[socket.addr].remove_socket(socket)
    else:
        socket.close()
def close(self, socket):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if socket.is_bound:
        self.sap[socket.addr].remove_socket(socket)
    else:
        socket.close()