libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
socket_type.hpp
Go to the documentation of this file.
1 #ifndef ISIMUD_EXCHANGES_COMMON_EXCHANGE_SOCKET_TYPE_HPP
2 # define ISIMUD_EXCHANGES_COMMON_EXCHANGE_SOCKET_TYPE_HPP
3 
4 /******************************************************************************
5 ** Copyright © 2019 by J.M.McGuiness, isimud@hussar.me.uk
6 **
7 ** This library is free software; you can redistribute it and/or
8 ** modify it under the terms of the GNU Lesser General Public
9 ** License as published by the Free Software Foundation; either
10 ** version 2.1 of the License, or (at your option) any later version.
11 **
12 ** This library is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ** Lesser General Public License for more details.
16 **
17 ** You should have received a copy of the GNU Lesser General Public
18 ** License along with this library; if not, write to the Free Software
19 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 
22 #include "core/socket_client_manager.hpp"
23 #include "core/thread_api_traits.hpp"
24 
25 namespace isimud { namespace ISIMUD_VER_NAMESPACE { namespace exchanges { namespace common {
26 
27 /// Allow one to easily choose the socket implementation used by the FIX-to-exchange translators.
28 namespace socket_type {
29  /// The socket write() methods, under heavy load, may not make a complete write of the buffer, and need to be repeatedly called. This means they may not be atomic, so this is a lock to make it atomic under such heavy loads.
30  using lock_type=libjmmcg::ppd::api_lock_traits<libjmmcg::ppd::platform_api, libjmmcg::ppd::heavyweight_threading>::critical_section_type::lock_type;
31 // TODO using lock_type=libjmmcg::ppd::api_lock_traits<libjmmcg::ppd::platform_api, libjmmcg::ppd::heavyweight_threading>::anon_spin_event_type::lock_type;
32 // TODO using lock_type=libjmmcg::ppd::api_lock_traits<libjmmcg::ppd::generic_traits::api_type::no_api, libjmmcg::ppd::sequential_mode>::critical_section_type::lock_type;
33 
34  using skt_mgr_t=libjmmcg::socket::asio::client_manager<lock_type>;
35 // TODO using skt_mgr_t=libjmmcg::socket::glibc::client_manager<lock_type>;
36 
38 
39 }
40 
41 } } } }
42 
43 #endif