Code Monkey home page Code Monkey logo

ipc's Introduction

IPC

MIT licensed Build status

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.

Integration with Bond is available at IPC.Bond.

Build

The library is developed and maintained with Visual Studio 2019. To get started, open the IPC.sln file and build the solution. The Boost package will automatically start downloading during the first build.

Getting Started

Start with examples, C++ and C# tests.

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

ipc's People

Contributors

ara-ayvazyan avatar microsoftopensource avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipc's Issues

warnings from visual studio code analysis

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".

Other OS Support

It would be more beneficial if a wide range of OSs were supported.

Compiled the new 2019 version - compilation error on unit tests

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)

vcpkg

Is there vcpkg for this library ?

Failed to send request: broken promise

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".

Is there some sort of timeout setting or is this an issue?
ipc_fail

Solution is not working in VS 2022

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

Typo in Product Description?

Should "...is available which allows interaction with C++ as well." be instead "is available which allows interaction with C# as well."?

Change to code that doesn't use boost

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.