]>
git.proxmox.com Git - ceph.git/blob - ceph/src/msg/simple/PipeConnection.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #include "msg/Message.h"
17 #include "SimpleMessenger.h"
18 #include "PipeConnection.h"
20 PipeConnection::~PipeConnection()
28 Pipe
* PipeConnection::get_pipe()
30 Mutex::Locker
l(lock
);
36 bool PipeConnection::try_get_pipe(Pipe
**p
)
38 Mutex::Locker
l(lock
);
50 bool PipeConnection::clear_pipe(Pipe
*old_p
)
52 Mutex::Locker
l(lock
);
62 void PipeConnection::reset_pipe(Pipe
*p
)
64 Mutex::Locker
l(lock
);
70 bool PipeConnection::is_connected()
72 return static_cast<SimpleMessenger
*>(msgr
)->is_connected(this);
75 int PipeConnection::send_message(Message
*m
)
78 return static_cast<SimpleMessenger
*>(msgr
)->send_message(m
, this);
81 void PipeConnection::send_keepalive()
83 static_cast<SimpleMessenger
*>(msgr
)->send_keepalive(this);
86 void PipeConnection::mark_down()
89 static_cast<SimpleMessenger
*>(msgr
)->mark_down(this);
92 void PipeConnection::mark_disposable()
95 static_cast<SimpleMessenger
*>(msgr
)->mark_disposable(this);