]>
git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/net/Dispatcher.h
cc6fd4574c7518da11c8471352ba1b0f35d0671d
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) 2017 Red Hat, Inc
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.
21 namespace crimson::net
{
25 virtual ~Dispatcher() {}
27 // Dispatchers are put into a chain as described by chain-of-responsibility
28 // pattern. If any of the dispatchers claims this message, it returns a valid
29 // future to prevent other dispatchers from processing it, and this is also
30 // used to throttle the connection if it's too busy.
31 virtual std::optional
<seastar::future
<>> ms_dispatch(ConnectionRef
, MessageRef
) = 0;
33 virtual void ms_handle_accept(ConnectionRef conn
) {}
35 virtual void ms_handle_connect(ConnectionRef conn
) {}
37 // a reset event is dispatched when the connection is closed unexpectedly.
38 // is_replace=true means the reset connection is going to be replaced by
39 // another accepting connection with the same peer_addr, which currently only
40 // happens under lossy policy when both sides wish to connect to each other.
41 virtual void ms_handle_reset(ConnectionRef conn
, bool is_replace
) {}
43 virtual void ms_handle_remote_reset(ConnectionRef conn
) {}
46 } // namespace crimson::net