microsoft / ipc Goto Github PK
View Code? Open in Web Editor NEWIPC is a C++ library that provides inter-process communication using shared memory on Windows. A .NET wrapper is available which allows interaction with C++ as well.
License: Other
IPC is a C++ library that provides inter-process communication using shared memory on Windows. A .NET wrapper is available which allows interaction with C++ as well.
License: Other
It would be more beneficial if a wide range of OSs were supported.
visual studio now integrates clang-tidy, here's the output of a run on the calc-native project. Some of these might be worth cleaning up. I didn't see any that I though were dormant bugs though.
2>CalcNative.vcxproj -> C:\local\IPC-master\x64\Debug\CalcNative.exe
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\smart_ptr\detail\local_counted_base.hpp(45): warning C26812: The enum type 'boost::detail::local_counted_base::count_type' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\date_time\gregorian\greg_weekday.hpp(55): warning C26812: The enum type 'boost::date_time::weekdays' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\date_time\gregorian\greg_month.hpp(61): warning C26812: The enum type 'boost::date_time::months_of_year' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\date_time\gregorian\greg_duration.hpp(38): warning C26812: The enum type 'boost::date_time::special_values' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\numeric\conversion\converter_policies.hpp(161): warning C26812: The enum type 'boost::numeric::range_check_result' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\win32_api.hpp(1372): warning C6248: Setting a SECURITY_DESCRIPTOR's DACL to NULL will result in an unprotected object.
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\win32_api.hpp(1367): warning C26495: Variable 'boost::interprocess::winapi::interprocess_all_access_security::sa' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\os_thread_functions.hpp(226): warning C26451: Arithmetic overflow: Using operator '<<' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '<<' to avoid overflow (io.2).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\errors.hpp(200): warning C26812: The enum type 'boost::interprocess::error_code_t' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\os_file_functions.hpp(125): warning C26812: The enum type 'boost::interprocess::mode_t' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\os_file_functions.hpp(161): warning C26498: The function 'std::numeric_limits<__int64>::max' is constexpr, mark variable 'max_filesize' constexpr if compile-time evaluation is desired (con.5).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\os_file_functions.hpp(202): warning C26812: The enum type 'boost::interprocess::file_pos_t' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\os_file_functions.hpp(242): warning C6282: Incorrect operator: assignment of constant in Boolean context. Consider using '==' instead.
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\os_file_functions.hpp(271): warning C6282: Incorrect operator: assignment of constant in Boolean context. Consider using '==' instead.
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\intrusive\options.hpp(249): warning C26812: The enum type 'boost::intrusive::link_mode_type' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\intrusive\sgtree.hpp(110): warning C26451: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\container\options.hpp(55): warning C26812: The enum type 'boost::container::tree_type_enum' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\intrusive\detail\is_stateful_value_traits.hpp(68): warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\intrusive\detail\is_stateful_value_traits.hpp(65): warning C6285: (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\mapped_region.hpp(143): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\mapped_region.hpp(160): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\mapped_region.hpp(549): warning C26812: The enum type 'boost::interprocess::mapped_region::advice_types' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\windows_shared_memory.hpp(92): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\windows_shared_memory.hpp(99): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\windows_shared_memory.hpp(145): warning C26495: Variable 'boost::interprocess::windows_shared_memory::m_mode' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\windows_shared_memory.hpp(174): warning C26812: The enum type 'boost::interprocess::ipcdetail::create_enum_t' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\sync\spin\recursive_mutex.hpp(75): warning C26495: Variable 'boost::interprocess::ipcdetail::spin_recursive_mutex::m_s' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\function\function_base.hpp(603): warning C26495: Variable 'boost::function_base::functor' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\lockfree\detail\freelist.hpp(267): warning C26495: Variable 'boost::lockfree::detail::tagged_index::tag' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\Inc\IPC\detail\Callback.h(72): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\function\function_template.hpp(1104): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\date_time\time.hpp(61): warning C26812: The enum type 'boost::date_time::dst_flags' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\optional\optional.hpp(140): warning C26495: Variable 'boost::optional_detail::optional_base<Calc::Response>::m_storage' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\function\function_template.hpp(1093): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\date_time\microsec_time_clock.hpp(125): warning C26451: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\function\function_template.hpp(750): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\date_time\constrained_value.hpp(108): warning C26812: The enum type 'boost::CV::violation_enum' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\intrusive\rbtree_algorithms.hpp(450): warning C26812: The enum type 'boost::intrusive::compact_rbtree_node<void *>::color' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\container\string.hpp(140): warning C26495: Variable 'boost::container::dtl::basic_string_base<IPC::SharedMemory::Allocator<char> >::long_t::storage' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\Inc\IPC\detail\Callback.h(71): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\Inc\IPC\detail\ChannelBase.h(62): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\smart_ptr\shared_ptr.hpp(176): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\Inc\IPC\Connector.h(71): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\container\detail\tree.hpp(217): warning C26495: Variable 'boost::container::dtl::tree_node<std::pair<boost::interprocess::ipcdetail::sync_id const * const,boost::unordered::iterator_detail::iterator<boost::unordered::detail::ptr_node<std::pair<boost::interprocess::ipcdetail::sync_id const ,void *> > > >,void *,0,1>::m_storage' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\lockfree\queue.hpp(128): warning C26495: Variable 'boost::lockfree::queue<unsigned int,boost::lockfree::capacity<64> >::node::data' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\optional\detail\optional_trivially_copyable_base.hpp(25): warning C26495: Variable 'boost::optional_detail::tc_optional_base<unsigned int>::m_storage' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\lockfree\detail\freelist.hpp(341): warning C26495: Variable 'boost::lockfree::detail::compiletime_sized_freelist_storage<boost::lockfree::queue<unsigned int,boost::lockfree::capacity<64> >::node,65>::data' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\segment_manager_helper.hpp(105): warning C26451: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\detail\segment_manager_helper.hpp(105): warning C26451: Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2).
C:\local\IPC-master\Inc\IPC\detail\Callback.h(27): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\interprocess\sync\scoped_lock.hpp(131): warning C26439: This kind of function may not throw. Declare it 'noexcept' (f.6).
C:\local\IPC-master\packages\boost.1.71.0.0\lib\native\include\boost\optional\detail\optional_trivially_copyable_base.hpp(29): warning C26495: Variable 'boost::optional_detail::tc_optional_base<unsigned int>::m_storage' is uninitialized. Always initialize a member variable (type.6).
C:\local\IPC-master\Inc\IPC\detail\LockFree\FixedQueue.h(29): warning C26495: Variable 'IPC::detail::LockFree::FixedQueue<IPC::detail::ConnectorPingInfo,64,void>::m_storage' is uninitialized. Always initialize a member variable (type.6).
2>Done building project "CalcNative.vcxproj".
Is there vcpkg for this library ?
Just testing with the included CalcNative example.
Running it normally works but trying to simulate a request that would take longer to process on the server side (In this case adding a sleep of 10 seconds) causes the client to fail with "Failed to send request: broken promise".
Test for native to/from managed communication is missing.
I don't know if this is an unreasonable demand.
While reviewing the use of this IPC library, I was asked if boost was absolutely necessary.
At this point, most of them can be replaced by standards such as c++17.
The internal code is well written, but the usability is not the best.
How do you think?
Currently the ClientAcceptor
, ServerConnector
, AcceptClient
and ConnectServer
functionality is missing in managed wrapper.
Currently ChannelSettings
is not available in managed wrapper.
There are several components that have Windows-specific implementation (e.g. thread pool, named events) which can be expanded with corresponding cross-platform versions.
Generating Code...
5>libboost_unit_test_framework-vc142-mt-gd-x64-1_71.lib(test_tools.obj) : error LNK2005: "public: __cdecl boost::test_tools::tt_detail::context_frame::context_frame(class boost::unit_test::lazy_ostream const &)" (??0context_frame@tt_detail@test_tools@boost@@qeaa@AEBVlazy_ostream@unit_test@3@@z) already defined in boost_unit_test_framework-vc140-mt-gd.lib(boost_unit_test_framework-vc142-mt-gd-x64-1_71.dll)
5>libboost_unit_test_framework-vc142-mt-gd-x64-1_71.lib(test_tools.obj) : error LNK2005: "public: __cdecl boost::test_tools::tt_detail::context_frame::~context_frame(void)" (??1context_frame@tt_detail@test_tools@boost@@qeaa@XZ) already defined in boost_unit_test_framework-vc140-mt-gd.lib(boost_unit_test_framework-vc142-mt-gd-x64-1_71.dll)
5>libboost_unit_test_framework-vc142-mt-gd-x64-1_71.lib(test_tools.obj) : error LNK2005: "public: __cdecl boost::test_tools::tt_detail::context_frame::operator bool(void)" (??Bcontext_frame@tt_detail@test_tools@boost@@QEAA_NXZ) already defined in boost_unit_test_framework-vc140-mt-gd.lib(boost_unit_test_framework-vc142-mt-gd-x64-1_71.dll)
Can anybody confirm that the solution is working in VS2022.
I get errors like:
Error C2440 "return": "initializer list" can not be converted into "IPC::SharedMemory::Allocator" CalcNative ...\IPC-master\IPC-master\Inc\IPC\SharedMemory.h 82
Currently only IVector is available. Would be good to add other containers such as list, set, map etc.
Currently all the tests are running within the same process. Would be good to have some that use separate ones.
Currently default security settings are used. It would be good to support permissions.
There should be at least some explanation of key concepts and workflow before lookinng into unit tests makes sense.
Using std::chrono::duration{}
may not produce the same value as std::chrono::duration::zero()
if duration_values is specialized.
I build IPC run as server in x64 and run as client in x86. It seems do not work. And just get
Press Ctrl+C to exit. Connecting to ipc://calc
Can you provide examples of C++ and C#?The test is too simpler,i don't know how to use it
Does this project support x86 platform on windows?
Should "...is available which allows interaction with C++ as well." be instead "is available which allows interaction with C# as well."?
AppVeyor and Travis
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.