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) 2013 CohortFS, LLC
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 "include/compat.h"
17 #include "simple_dispatcher.h"
18 #include "messages/MPing.h"
19 #include "messages/MDataPing.h"
21 SimpleDispatcher::SimpleDispatcher(Messenger *msgr) :
22 Dispatcher(msgr->cct),
30 SimpleDispatcher::~SimpleDispatcher() {
34 bool SimpleDispatcher::ms_dispatch(Message *m)
40 ConnectionRef con = m->get_connection();
41 Messenger* msgr = con->get_messenger();
43 switch (m->get_type()) {
48 MDataPing* mdp __attribute__((unused)) = static_cast<MDataPing*>(m);
49 //cout << "MDataPing " << mdp->tag << " " << mdp->counter << std::endl;
50 //mdp->get_data().hexdump(cout);
51 ConnectionRef con = m->get_connection();
59 if (unlikely(msgr->get_magic() & MSG_MAGIC_TRACE_CTR)) {
60 if (unlikely(dc % 65536) == 0) {
62 clock_gettime(CLOCK_REALTIME_COARSE, &ts);
63 std::cout << "ping " << dc << " nanos: " <<
64 ts.tv_nsec + (ts.tv_sec * 1000000000) << std::endl;
76 bool SimpleDispatcher::ms_handle_reset(Connection *con)
81 void SimpleDispatcher::ms_handle_remote_reset(Connection *con)