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 "xio_dispatcher.h"
16 #include "messages/MPing.h"
17 #include "messages/MDataPing.h"
19 XioDispatcher::XioDispatcher(Messenger *msgr) :
20 Dispatcher(msgr->cct),
28 XioDispatcher::~XioDispatcher() {
32 bool XioDispatcher::ms_dispatch(Message *m)
39 switch (m->get_type()) {
44 MDataPing* mdp __attribute__((unused)) = static_cast<MDataPing*>(m);
45 //cout << "MDataPing " << mdp->tag << " " << mdp->counter << std::endl;
46 //mdp->get_data().hexdump(cout);
53 if (unlikely(m->get_magic() & MSG_MAGIC_TRACE_CTR)) {
54 if (unlikely(dc % 65536) == 0) {
56 clock_gettime(CLOCK_REALTIME_COARSE, &ts);
57 std::cout << "ping " << dc << " nanos: " <<
58 ts.tv_nsec + (ts.tv_sec * 1000000000) << std::endl;
67 bool XioDispatcher::ms_handle_reset(Connection *con)
72 void XioDispatcher::ms_handle_remote_reset(Connection *con)