From f0aa29d553cacc5fee96d89bbbfa154dd49af960 Mon Sep 17 00:00:00 2001 From: Rieger Date: Thu, 14 Mar 2024 10:14:12 -0400 Subject: [PATCH] websocket client adapter Signed-off-by: Rieger --- CMakeLists.txt | 1 + NOTICE | 815 +++++++++++------- conda/dev-environment-unix.yml | 2 + cpp/csp/adapters/CMakeLists.txt | 4 + cpp/csp/adapters/websocket/CMakeLists.txt | 41 + .../websocket/ClientAdapterManager.cpp | 130 +++ .../adapters/websocket/ClientAdapterManager.h | 77 ++ .../websocket/ClientHeaderUpdateAdapter.cpp | 20 + .../websocket/ClientHeaderUpdateAdapter.h | 35 + .../adapters/websocket/ClientInputAdapter.cpp | 42 + .../adapters/websocket/ClientInputAdapter.h | 34 + .../websocket/ClientOutputAdapter.cpp | 17 + .../adapters/websocket/ClientOutputAdapter.h | 35 + .../adapters/websocket/WebsocketEndpoint.cpp | 189 ++++ .../adapters/websocket/WebsocketEndpoint.h | 84 ++ cpp/csp/python/adapters/CMakeLists.txt | 6 + .../python/adapters/websocketadapterimpl.cpp | 86 ++ csp/adapters/websocket.py | 114 ++- csp/adapters/websocket_types.py | 17 + csp/impl/wiring/numba_node.py | 12 +- examples/3_using_adapters/websocket_client.py | 33 + setup.py | 3 +- vcpkg.json | 3 +- 23 files changed, 1501 insertions(+), 299 deletions(-) create mode 100644 cpp/csp/adapters/websocket/CMakeLists.txt create mode 100644 cpp/csp/adapters/websocket/ClientAdapterManager.cpp create mode 100644 cpp/csp/adapters/websocket/ClientAdapterManager.h create mode 100644 cpp/csp/adapters/websocket/ClientHeaderUpdateAdapter.cpp create mode 100644 cpp/csp/adapters/websocket/ClientHeaderUpdateAdapter.h create mode 100644 cpp/csp/adapters/websocket/ClientInputAdapter.cpp create mode 100644 cpp/csp/adapters/websocket/ClientInputAdapter.h create mode 100644 cpp/csp/adapters/websocket/ClientOutputAdapter.cpp create mode 100644 cpp/csp/adapters/websocket/ClientOutputAdapter.h create mode 100644 cpp/csp/adapters/websocket/WebsocketEndpoint.cpp create mode 100644 cpp/csp/adapters/websocket/WebsocketEndpoint.h create mode 100644 cpp/csp/python/adapters/websocketadapterimpl.cpp create mode 100644 csp/adapters/websocket_types.py create mode 100644 examples/3_using_adapters/websocket_client.py diff --git a/CMakeLists.txt b/CMakeLists.txt index fbdf2783e..b0b37d44d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,7 @@ option(CSP_USE_LD_CLASSIC_MAC "On macOS, link with ld_classic" OFF) # Extension options option(CSP_BUILD_KAFKA_ADAPTER "Build kafka adapter" ON) option(CSP_BUILD_PARQUET_ADAPTER "Build parquet adapter" ON) +option(CSP_BUILD_WS_CLIENT_ADAPTER "Build ws client adapter" ON) # Normalize build type for downstream comparisons string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) diff --git a/NOTICE b/NOTICE index 7466d5d85..1a612c0e5 100644 --- a/NOTICE +++ b/NOTICE @@ -2,7 +2,7 @@ CSP - Copyright 2024 Point72, L.P. This project contains software with the below copyrights -vcpkg_installed/arm64-osx/share/abseil/copyright +vcpkg_installed/x64-linux/share/abseil/copyright @@ -210,7 +210,7 @@ vcpkg_installed/arm64-osx/share/abseil/copyright -vcpkg_installed/arm64-osx/share/arrow/copyright +vcpkg_installed/x64-linux/share/arrow/copyright @@ -418,77 +418,6 @@ vcpkg_installed/arm64-osx/share/arrow/copyright -------------------------------------------------------------------------------- -src/plasma/fling.cc and src/plasma/fling.h: Apache 2.0 - -Copyright 2013 Sharvil Nanavati - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - --------------------------------------------------------------------------------- - -src/plasma/thirdparty/ae: Modified / 3-Clause BSD - -Copyright (c) 2006-2010, Salvatore Sanfilippo -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Redis nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------------------- - -src/plasma/thirdparty/dlmalloc.c: CC0 - -This is a version (aka dlmalloc) of malloc/free/realloc written by -Doug Lea and released to the public domain, as explained at -http://creativecommons.org/publicdomain/zero/1.0/ Send questions, -comments, complaints, performance data, etc to dl@cs.oswego.edu - --------------------------------------------------------------------------------- - -src/plasma/common.cc (some portions) - -Copyright (c) Austin Appleby (aappleby (AT) gmail) - -Some portions of this file are derived from code in the MurmurHash project - -All code is released to the public domain. For business purposes, Murmurhash is -under the MIT license. - -https://sites.google.com/site/murmurhash/ - --------------------------------------------------------------------------------- - src/arrow/util (some portions): Apache 2.0, and 3-clause BSD Some portions of this module are derived from code in the Chromium project, @@ -868,34 +797,6 @@ SOFTWARE. -------------------------------------------------------------------------------- -The file cpp/src/arrow/vendored/string_view.hpp has the following license - -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - The files in cpp/src/arrow/vendored/xxhash/ have the following license (BSD 2-Clause License) @@ -2203,17 +2104,6 @@ for PyArrow. Ibis is released under the Apache License, Version 2.0. -------------------------------------------------------------------------------- -This project includes code from the autobrew project. - -* r/tools/autobrew and dev/tasks/homebrew-formulae/autobrew/apache-arrow.rb - are based on code from the autobrew project. - -Copyright (c) 2019, Jeroen Ooms -License: MIT -Homepage: https://github.com/jeroen/autobrew - --------------------------------------------------------------------------------- - dev/tasks/homebrew-formulae/apache-arrow.rb has the following license: BSD 2-Clause License @@ -2272,34 +2162,6 @@ René Nyffenegger rene.nyffenegger@adp-gmbh.ch -------------------------------------------------------------------------------- -The file cpp/src/arrow/vendored/optional.hpp has the following license - -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------------- - This project includes code from Folly. * cpp/src/arrow/vendored/ProducerConsumerQueue.h @@ -2459,8 +2321,211 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- + +The file src/arrow/util/io_util.cc contains code from the CPython project +which is made available under the Python Software Foundation License Version 2. + +-------------------------------------------------------------------------------- + +3rdparty dependency opentelemetry-cpp is statically linked in certain binary +distributions. opentelemetry-cpp is made available under the Apache License 2.0. + +Copyright The OpenTelemetry Authors +SPDX-License-Identifier: Apache-2.0 + +-------------------------------------------------------------------------------- + +ci/conan/ is based on code from Conan Package and Dependency Manager. + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +-------------------------------------------------------------------------------- + +3rdparty dependency UCX is redistributed as a dynamically linked shared +library in certain binary distributions. UCX has the following license: + +Copyright (c) 2014-2015 UT-Battelle, LLC. All rights reserved. +Copyright (C) 2014-2020 Mellanox Technologies Ltd. All rights reserved. +Copyright (C) 2014-2015 The University of Houston System. All rights reserved. +Copyright (C) 2015 The University of Tennessee and The University + of Tennessee Research Foundation. All rights reserved. +Copyright (C) 2016-2020 ARM Ltd. All rights reserved. +Copyright (c) 2016 Los Alamos National Security, LLC. All rights reserved. +Copyright (C) 2016-2020 Advanced Micro Devices, Inc. All rights reserved. +Copyright (C) 2019 UChicago Argonne, LLC. All rights reserved. +Copyright (c) 2018-2020 NVIDIA CORPORATION. All rights reserved. +Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. +Copyright (C) 2016-2020 Stony Brook University. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------------------- + +The file dev/tasks/r/github.packages.yml contains code from + +https://github.com/ursa-labs/arrow-r-nightly + +which is made available under the Apache License 2.0. + +-------------------------------------------------------------------------------- +.github/actions/sync-nightlies/action.yml (some portions) + +Some portions of this file are derived from code from + +https://github.com/JoshPiper/rsync-docker + +which is made available under the MIT license + +Copyright (c) 2020 Joshua Piper + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +-------------------------------------------------------------------------------- +.github/actions/sync-nightlies/action.yml (some portions) + +Some portions of this file are derived from code from + +https://github.com/burnett01/rsync-deployments + +which is made available under the MIT license + +Copyright (c) 2019-2022 Contention +Copyright (c) 2019-2022 Burnett01 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +vcpkg_installed/x64-linux/share/boost-algorithm/copyright + + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + +vcpkg_installed/x64-linux/share/boost-align/copyright + + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + -vcpkg_installed/arm64-osx/share/boost-algorithm/copyright +vcpkg_installed/x64-linux/share/boost-array/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2488,7 +2553,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-align/copyright +vcpkg_installed/x64-linux/share/boost-asio/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2516,7 +2581,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-array/copyright +vcpkg_installed/x64-linux/share/boost-assert/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2544,7 +2609,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-assert/copyright +vcpkg_installed/x64-linux/share/boost-atomic/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2572,7 +2637,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-atomic/copyright +vcpkg_installed/x64-linux/share/boost-bind/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2600,7 +2665,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-bind/copyright +vcpkg_installed/x64-linux/share/boost-build/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2628,7 +2693,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-build/copyright +vcpkg_installed/x64-linux/share/boost-chrono/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2656,7 +2721,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-chrono/copyright +vcpkg_installed/x64-linux/share/boost-concept-check/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2684,7 +2749,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-concept-check/copyright +vcpkg_installed/x64-linux/share/boost-config/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2712,7 +2777,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-config/copyright +vcpkg_installed/x64-linux/share/boost-container/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2740,7 +2805,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-container-hash/copyright +vcpkg_installed/x64-linux/share/boost-container-hash/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2768,7 +2833,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-container/copyright +vcpkg_installed/x64-linux/share/boost-context/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2796,7 +2861,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-conversion/copyright +vcpkg_installed/x64-linux/share/boost-conversion/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2824,7 +2889,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-core/copyright +vcpkg_installed/x64-linux/share/boost-core/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2852,7 +2917,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-date-time/copyright +vcpkg_installed/x64-linux/share/boost-coroutine/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2880,7 +2945,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-describe/copyright +vcpkg_installed/x64-linux/share/boost-date-time/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2908,7 +2973,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-detail/copyright +vcpkg_installed/x64-linux/share/boost-describe/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2936,7 +3001,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-dynamic-bitset/copyright +vcpkg_installed/x64-linux/share/boost-detail/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2964,7 +3029,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-exception/copyright +vcpkg_installed/x64-linux/share/boost-dynamic-bitset/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -2992,7 +3057,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-filesystem/copyright +vcpkg_installed/x64-linux/share/boost-exception/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3020,7 +3085,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-function-types/copyright +vcpkg_installed/x64-linux/share/boost-filesystem/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3048,7 +3113,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-function/copyright +vcpkg_installed/x64-linux/share/boost-functional/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3076,7 +3141,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-functional/copyright +vcpkg_installed/x64-linux/share/boost-function/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3104,7 +3169,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-fusion/copyright +vcpkg_installed/x64-linux/share/boost-function-types/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3132,7 +3197,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-integer/copyright +vcpkg_installed/x64-linux/share/boost-fusion/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3160,7 +3225,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-intrusive/copyright +vcpkg_installed/x64-linux/share/boost-integer/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3188,7 +3253,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-io/copyright +vcpkg_installed/x64-linux/share/boost-intrusive/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3216,7 +3281,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-iterator/copyright +vcpkg_installed/x64-linux/share/boost-io/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3244,7 +3309,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-lexical-cast/copyright +vcpkg_installed/x64-linux/share/boost-iterator/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3272,7 +3337,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-locale/copyright +vcpkg_installed/x64-linux/share/boost-lexical-cast/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3300,7 +3365,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-math/copyright +vcpkg_installed/x64-linux/share/boost-locale/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3328,7 +3393,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-move/copyright +vcpkg_installed/x64-linux/share/boost-math/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3356,7 +3421,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-mp11/copyright +vcpkg_installed/x64-linux/share/boost-move/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3384,7 +3449,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-mpl/copyright +vcpkg_installed/x64-linux/share/boost-mp11/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3412,7 +3477,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-multiprecision/copyright +vcpkg_installed/x64-linux/share/boost-mpl/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3440,7 +3505,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-numeric-conversion/copyright +vcpkg_installed/x64-linux/share/boost-multiprecision/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3468,7 +3533,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-optional/copyright +vcpkg_installed/x64-linux/share/boost-numeric-conversion/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3496,7 +3561,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-predef/copyright +vcpkg_installed/x64-linux/share/boost-optional/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3524,7 +3589,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-preprocessor/copyright +vcpkg_installed/x64-linux/share/boost-pool/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3552,7 +3617,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-random/copyright +vcpkg_installed/x64-linux/share/boost-predef/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3580,7 +3645,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-range/copyright +vcpkg_installed/x64-linux/share/boost-preprocessor/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3608,7 +3673,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-ratio/copyright +vcpkg_installed/x64-linux/share/boost-random/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3636,7 +3701,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-rational/copyright +vcpkg_installed/x64-linux/share/boost-range/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3664,7 +3729,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-regex/copyright +vcpkg_installed/x64-linux/share/boost-ratio/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3692,7 +3757,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-scope-exit/copyright +vcpkg_installed/x64-linux/share/boost-rational/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3720,7 +3785,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-smart-ptr/copyright +vcpkg_installed/x64-linux/share/boost-regex/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3748,7 +3813,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-static-assert/copyright +vcpkg_installed/x64-linux/share/boost-scope-exit/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3776,7 +3841,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-system/copyright +vcpkg_installed/x64-linux/share/boost-smart-ptr/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3804,7 +3869,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-thread/copyright +vcpkg_installed/x64-linux/share/boost-static-assert/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3832,7 +3897,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-throw-exception/copyright +vcpkg_installed/x64-linux/share/boost-system/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3860,7 +3925,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-tokenizer/copyright +vcpkg_installed/x64-linux/share/boost-thread/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3888,7 +3953,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-tuple/copyright +vcpkg_installed/x64-linux/share/boost-throw-exception/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3916,7 +3981,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-type-traits/copyright +vcpkg_installed/x64-linux/share/boost-tokenizer/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3944,7 +4009,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-typeof/copyright +vcpkg_installed/x64-linux/share/boost-tuple/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -3972,7 +4037,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-unordered/copyright +vcpkg_installed/x64-linux/share/boost-typeof/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -4000,7 +4065,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-utility/copyright +vcpkg_installed/x64-linux/share/boost-type-traits/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -4028,7 +4093,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-variant2/copyright +vcpkg_installed/x64-linux/share/boost-unordered/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -4056,7 +4121,63 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-vcpkg-helpers/copyright +vcpkg_installed/x64-linux/share/boost-utility/copyright + + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + +vcpkg_installed/x64-linux/share/boost-variant2/copyright + + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + +vcpkg_installed/x64-linux/share/boost-vcpkg-helpers/copyright Copyright (c) Microsoft Corporation @@ -4084,7 +4205,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/boost-winapi/copyright +vcpkg_installed/x64-linux/share/boost-winapi/copyright Boost Software License - Version 1.0 - August 17th, 2003 @@ -4112,7 +4233,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/brotli/copyright +vcpkg_installed/x64-linux/share/brotli/copyright Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. @@ -4136,7 +4257,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/bzip2/copyright +vcpkg_installed/x64-linux/share/bzip2/copyright @@ -4183,7 +4304,7 @@ bzip2/libbzip2 version 1.0.8 of 13 July 2019 -------------------------------------------------------------------------- -vcpkg_installed/arm64-osx/share/exprtk/copyright +vcpkg_installed/x64-linux/share/exprtk/copyright Copyright 1999-2022 Arash Partow @@ -4196,7 +4317,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/gflags/copyright +vcpkg_installed/x64-linux/share/gflags/copyright Copyright (c) 2006, Google Inc. @@ -4229,77 +4350,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -vcpkg_installed/arm64-osx/share/glog/copyright - - -Copyright (c) 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -A function gettimeofday in utilities.cc is based on - -http://www.google.com/codesearch/p?hl=en#dR3YEbitojA/COPYING&q=GetSystemTimeAsFileTime%20license:bsd - -The license of this code is: - -Copyright (c) 2003-2008, Jouni Malinen and contributors -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -3. Neither the name(s) of the above-listed copyright holder(s) nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -vcpkg_installed/arm64-osx/share/gtest/copyright +vcpkg_installed/x64-linux/share/gtest/copyright Copyright 2008, Google Inc. @@ -4332,7 +4383,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -vcpkg_installed/arm64-osx/share/libevent/copyright +vcpkg_installed/x64-linux/share/libevent/copyright Libevent is available for use under the following license, commonly known @@ -4488,7 +4539,7 @@ limitations under the License. This file is part of mbed TLS (https://tls.mbed.org) -vcpkg_installed/arm64-osx/share/librdkafka/copyright +vcpkg_installed/x64-linux/share/librdkafka/copyright LICENSE @@ -4885,7 +4936,7 @@ For the files wingetopt.c wingetopt.h downloaded from https://github.com/alex85k -vcpkg_installed/arm64-osx/share/lz4/copyright +vcpkg_installed/x64-linux/share/lz4/copyright LZ4 Library @@ -4914,7 +4965,7 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -vcpkg_installed/arm64-osx/share/openssl/copyright +vcpkg_installed/x64-linux/share/openssl/copyright @@ -5096,7 +5147,7 @@ vcpkg_installed/arm64-osx/share/openssl/copyright END OF TERMS AND CONDITIONS -vcpkg_installed/arm64-osx/share/protobuf/copyright +vcpkg_installed/x64-linux/share/protobuf/copyright Copyright 2008 Google Inc. All rights reserved. @@ -5133,7 +5184,7 @@ standalone and requires a support library to be linked with it. This support library is itself covered by the above license. -vcpkg_installed/arm64-osx/share/rapidjson/copyright +vcpkg_installed/x64-linux/share/rapidjson/copyright Tencent is pleased to support the open source community by making RapidJSON available. @@ -5195,7 +5246,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/re2/copyright +vcpkg_installed/x64-linux/share/re2/copyright // Copyright (c) 2009 The RE2 Authors. All rights reserved. @@ -5227,7 +5278,7 @@ vcpkg_installed/arm64-osx/share/re2/copyright // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -vcpkg_installed/arm64-osx/share/snappy/copyright +vcpkg_installed/x64-linux/share/snappy/copyright Copyright 2011, Google Inc. @@ -5286,7 +5337,7 @@ Some of the benchmark data in testdata/ is licensed differently: (http://www.gutenberg.org/ebooks/53). -vcpkg_installed/arm64-osx/share/thrift/copyright +vcpkg_installed/x64-linux/share/thrift/copyright @@ -5597,7 +5648,7 @@ For t_cl_generator.cc --------------------------------------------------- -vcpkg_installed/arm64-osx/share/utf8proc/copyright +vcpkg_installed/x64-linux/share/utf8proc/copyright ## utf8proc license ## @@ -5695,7 +5746,7 @@ registered in some jurisdictions. All other trademarks and registered trademarks mentioned herein are the property of their respective owners. -vcpkg_installed/arm64-osx/share/vcpkg-cmake-config/copyright +vcpkg_installed/x64-linux/share/vcpkg-cmake-config/copyright Copyright (c) Microsoft Corporation @@ -5723,7 +5774,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/vcpkg-cmake-get-vars/copyright +vcpkg_installed/x64-linux/share/vcpkg-cmake/copyright MIT License @@ -5748,7 +5799,7 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/vcpkg-cmake/copyright +vcpkg_installed/x64-linux/share/vcpkg-cmake-get-vars/copyright MIT License @@ -5773,7 +5824,191 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -vcpkg_installed/arm64-osx/share/zlib/copyright +vcpkg_installed/x64-linux/share/websocketpp/copyright + + +Main Library: + +Copyright (c) 2014, Peter Thorson. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the WebSocket++ Project nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL PETER THORSON BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Bundled Libraries: + +****** Base 64 Library (base64/base64.hpp) ****** +base64.hpp is a repackaging of the base64.cpp and base64.h files into a +single header suitable for use as a header only library. This conversion was +done by Peter Thorson (webmaster@zaphoyd.com) in 2012. All modifications to +the code are redistributed under the same license as the original, which is +listed below. + +base64.cpp and base64.h + +Copyright (C) 2004-2008 René Nyffenegger + +This source code is provided 'as-is', without any express or implied +warranty. In no event will the author be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this source code must not be misrepresented; you must not + claim that you wrote the original source code. If you use this source code + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original source code. + +3. This notice may not be removed or altered from any source distribution. + +René Nyffenegger rene.nyffenegger@adp-gmbh.ch + +****** SHA1 Library (sha1/sha1.hpp) ****** +sha1.hpp is a repackaging of the sha1.cpp and sha1.h files from the shallsha1 +library (http://code.google.com/p/smallsha1/) into a single header suitable for +use as a header only library. This conversion was done by Peter Thorson +(webmaster@zaphoyd.com) in 2013. All modifications to the code are redistributed +under the same license as the original, which is listed below. + + Copyright (c) 2011, Micael Hildenborg + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Micael Hildenborg nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY Micael Hildenborg ''AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL Micael Hildenborg BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +****** MD5 Library (common/md5.hpp) ****** +md5.hpp is a reformulation of the md5.h and md5.c code from +http://www.opensource.apple.com/source/cups/cups-59/cups/md5.c to allow it to +function as a component of a header only library. This conversion was done by +Peter Thorson (webmaster@zaphoyd.com) in 2012 for the WebSocket++ project. The +changes are released under the same license as the original (listed below) + +Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +L. Peter Deutsch +ghost@aladdin.com + +****** UTF8 Validation logic (utf8_validation.hpp) ****** +utf8_validation.hpp is adapted from code originally written by Bjoern Hoehrmann +. See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for +details. + +The original license: + +Copyright (c) 2008-2009 Bjoern Hoehrmann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +vcpkg_installed/x64-linux/share/xsimd/copyright + + +Copyright (c) 2016, Johan Mabille, Sylvain Corlay, Wolf Vollprecht and Martin Renou +Copyright (c) 2016, QuantStack +Copyright (c) 2018, Serge Guelton +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +vcpkg_installed/x64-linux/share/zlib/copyright Copyright notice: @@ -5800,7 +6035,7 @@ Copyright notice: jloup@gzip.org madler@alumni.caltech.edu -vcpkg_installed/arm64-osx/share/zstd/copyright +vcpkg_installed/x64-linux/share/zstd/copyright ZSTD is dual licensed under BSD and GPLv2. @@ -6183,7 +6418,7 @@ Public License instead of this License. -vcpkg_installed/arm64-osx/tools/boost-build/src/engine/debian/copyright +vcpkg_installed/x64-linux/tools/boost-build/src/engine/debian/copyright This package was debianized by Vladimir Prus on diff --git a/conda/dev-environment-unix.yml b/conda/dev-environment-unix.yml index 3f0071971..5faf83b48 100644 --- a/conda/dev-environment-unix.yml +++ b/conda/dev-environment-unix.yml @@ -18,6 +18,7 @@ dependencies: - isort - libarrow=15 - librdkafka + - libboost-headers - lz4-c - mamba - mdformat @@ -47,4 +48,5 @@ dependencies: - twine - unzip - wheel + - websocketpp - zip diff --git a/cpp/csp/adapters/CMakeLists.txt b/cpp/csp/adapters/CMakeLists.txt index 77e294fd5..41a929dcf 100644 --- a/cpp/csp/adapters/CMakeLists.txt +++ b/cpp/csp/adapters/CMakeLists.txt @@ -7,4 +7,8 @@ if(CSP_BUILD_PARQUET_ADAPTER) add_subdirectory(parquet) endif() +if(CSP_BUILD_WS_CLIENT_ADAPTER) + add_subdirectory(websocket) +endif() + add_subdirectory(utils) diff --git a/cpp/csp/adapters/websocket/CMakeLists.txt b/cpp/csp/adapters/websocket/CMakeLists.txt new file mode 100644 index 000000000..73513d975 --- /dev/null +++ b/cpp/csp/adapters/websocket/CMakeLists.txt @@ -0,0 +1,41 @@ +csp_autogen( csp.adapters.websocket_types websocket_types WEBSOCKET_HEADER WEBSOCKET_SOURCE ) + +set(WS_CLIENT_HEADER_FILES + ClientAdapterManager.h + ClientInputAdapter.h + ClientOutputAdapter.h + ClientHeaderUpdateAdapter.h + WebsocketEndpoint.h + ${WEBSOCKET_HEADER} +) + +set(WS_CLIENT_SOURCE_FILES + ClientAdapterManager.cpp + ClientInputAdapter.cpp + ClientOutputAdapter.cpp + ClientHeaderUpdateAdapter.cpp + WebsocketEndpoint.cpp + ${WS_CLIENT_HEADER_FILES} + ${WEBSOCKET_SOURCE} +) + +add_library(csp_websocket_client_adapter STATIC ${WS_CLIENT_SOURCE_FILES}) +set_target_properties(csp_websocket_client_adapter PROPERTIES PUBLIC_HEADER "${WS_CLIENT_SOURCE_FILES}") + +find_package(websocketpp REQUIRED) +#set(OPENSSL_USE_STATIC_LIBS TRUE) +find_package(OpenSSL REQUIRED) + +target_link_libraries(csp_websocket_client_adapter + PRIVATE + csp_adapter_utils + ${OPENSSL_SSL_LIBRARY} + ${OPENSSL_CRYPTO_LIBRARY} + websocketpp::websocketpp +) + +install(TARGETS csp_websocket_client_adapter + PUBLIC_HEADER DESTINATION include/csp/adapters/websocket + RUNTIME DESTINATION bin/ + LIBRARY DESTINATION lib/ + ) diff --git a/cpp/csp/adapters/websocket/ClientAdapterManager.cpp b/cpp/csp/adapters/websocket/ClientAdapterManager.cpp new file mode 100644 index 000000000..e56011d13 --- /dev/null +++ b/cpp/csp/adapters/websocket/ClientAdapterManager.cpp @@ -0,0 +1,130 @@ +#include + +#include +#include +#include +#include + +namespace csp { + +INIT_CSP_ENUM( adapters::websocket::ClientStatusType, + "ACTIVE", + "GENERIC_ERROR", + "CONNECTION_FAILED", + "CLOSED", + "MESSAGE_SEND_FAIL", +); + +} + +// With TLS +namespace csp::adapters::websocket { + +ClientAdapterManager::ClientAdapterManager( Engine* engine, const Dictionary & properties ) +: AdapterManager( engine ), + m_active( false ), + m_shouldRun( false ), + m_endpoint( nullptr ), + m_inputAdapter( nullptr ), + m_outputAdapter( nullptr ), + m_updateAdapter( nullptr ), + m_thread( nullptr ), + m_properties( properties ) +{ + if( m_properties.get( "use_tls" ) ) + { + m_endpoint = new WebsocketEndpointTLS( properties ); + } + else + { + m_endpoint = new WebsocketEndpointNoTLS( properties ); + } + + if( m_inputAdapter != nullptr ) + { + m_endpoint -> setOnMessageCb( [ this ]( std::string msg ) { + PushBatch batch( m_engine -> rootEngine() ); + m_inputAdapter -> processMessage( msg, &batch ); + }); + } + m_endpoint -> setOnOpenCb( [ this ]() { + m_active = true; + pushStatus( StatusLevel::INFO, ClientStatusType::ACTIVE, "Connected successfully" ); + }); + m_endpoint -> setOnFailCb( [ this ]() { + m_active = false; + pushStatus( StatusLevel::ERROR, ClientStatusType::CONNECTION_FAILED, "Connection failed, will try to reconnect" ); + }); + m_endpoint -> setOnCloseCb( [ this ]() { + m_active = false; + pushStatus( StatusLevel::INFO, ClientStatusType::CLOSED, "Connection closed" ); + }); + m_endpoint -> setOnSendFailCb( [ this ]( const std::string& s ) { + std::stringstream ss; + ss << "Failed to send: " << s; + pushStatus( StatusLevel::ERROR, ClientStatusType::MESSAGE_SEND_FAIL, ss.str() ); + }); + +}; + +ClientAdapterManager::~ClientAdapterManager() +{ }; + +void ClientAdapterManager::start( DateTime starttime, DateTime endtime ) +{ + AdapterManager::start( starttime, endtime ); + // start the bg thread + m_shouldRun = true; + m_thread = std::make_unique( [ this ]() { + while( m_shouldRun ) + { + m_endpoint -> run(); + m_active = false; + if( m_shouldRun ) sleep( m_properties.get( "reconnect_interval" ) ); + } + }); +}; + +void ClientAdapterManager::stop() { + AdapterManager::stop(); + + m_shouldRun=false; + if( m_active ) m_endpoint->close(); + if( m_thread ) m_thread->join(); +}; + +PushInputAdapter* ClientAdapterManager::getInputAdapter(CspTypePtr & type, PushMode pushMode, const Dictionary & properties) +{ + if (m_inputAdapter == nullptr) + { + m_inputAdapter = m_engine -> createOwnedObject( + // m_engine, + type, + pushMode, + properties + ); + } + return m_inputAdapter; +}; + +OutputAdapter* ClientAdapterManager::getOutputAdapter() +{ + if (m_outputAdapter == nullptr) m_outputAdapter = m_engine -> createOwnedObject(m_endpoint); + + return m_outputAdapter; +} + +OutputAdapter * ClientAdapterManager::getHeaderUpdateAdapter() +{ + if (m_updateAdapter == nullptr) m_updateAdapter = m_engine -> createOwnedObject( m_endpoint -> getProperties() ); + + return m_updateAdapter; +} + +DateTime ClientAdapterManager::processNextSimTimeSlice( DateTime time ) +{ + // no sim data + return DateTime::NONE(); +} + +} diff --git a/cpp/csp/adapters/websocket/ClientAdapterManager.h b/cpp/csp/adapters/websocket/ClientAdapterManager.h new file mode 100644 index 000000000..ec80a356c --- /dev/null +++ b/cpp/csp/adapters/websocket/ClientAdapterManager.h @@ -0,0 +1,77 @@ +#ifndef _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_ADAPTERMGR_H +#define _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_ADAPTERMGR_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace csp::adapters::websocket { + +using namespace csp; + +struct WebsocketClientStatusTypeTraits +{ + enum _enum : unsigned char + { + ACTIVE = 0, + GENERIC_ERROR = 1, + CONNECTION_FAILED = 2, + CLOSED = 3, + MESSAGE_SEND_FAIL = 4, + + NUM_TYPES + }; + +protected: + _enum m_value; +}; + +using ClientStatusType = Enum; + +class ClientAdapterManager final : public AdapterManager +{ + + +public: + ClientAdapterManager( + Engine * engine, + const Dictionary & properties + ); + ~ClientAdapterManager(); + + const char * name() const override { return "WebsocketClientAdapterManager"; } + + void start( DateTime starttime, DateTime endtime ) override; + + void stop() override; + + PushInputAdapter * getInputAdapter( CspTypePtr & type, PushMode pushMode, const Dictionary & properties ); + OutputAdapter * getOutputAdapter(); + OutputAdapter * getHeaderUpdateAdapter(); + + DateTime processNextSimTimeSlice( DateTime time ) override; + +private: + // need some client info + + bool m_active; + bool m_shouldRun; + WebsocketEndpointBase* m_endpoint; + ClientInputAdapter* m_inputAdapter; + ClientOutputAdapter* m_outputAdapter; + ClientHeaderUpdateOutputAdapter* m_updateAdapter; + std::unique_ptr m_thread; + Dictionary m_properties; +}; + +} + +#endif \ No newline at end of file diff --git a/cpp/csp/adapters/websocket/ClientHeaderUpdateAdapter.cpp b/cpp/csp/adapters/websocket/ClientHeaderUpdateAdapter.cpp new file mode 100644 index 000000000..995bd7314 --- /dev/null +++ b/cpp/csp/adapters/websocket/ClientHeaderUpdateAdapter.cpp @@ -0,0 +1,20 @@ +#include + +namespace csp::adapters::websocket { + +ClientHeaderUpdateOutputAdapter::ClientHeaderUpdateOutputAdapter( + Engine * engine, + Dictionary& properties +) : OutputAdapter( engine ), m_properties( properties ) +{ }; + +void ClientHeaderUpdateOutputAdapter::executeImpl() +{ + DictionaryPtr headers = m_properties.get("headers"); + for( auto& update : input() -> lastValueTyped>() ) + { + if( update -> key_isSet() && update -> value_isSet() ) headers->update( update->key(), update->value() ); + } +}; + +} \ No newline at end of file diff --git a/cpp/csp/adapters/websocket/ClientHeaderUpdateAdapter.h b/cpp/csp/adapters/websocket/ClientHeaderUpdateAdapter.h new file mode 100644 index 000000000..96459aaa3 --- /dev/null +++ b/cpp/csp/adapters/websocket/ClientHeaderUpdateAdapter.h @@ -0,0 +1,35 @@ +#ifndef _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_HEADERUPDATEADAPTER_H +#define _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_HEADERUPDATEADAPTER_H + +#include +#include +#include +#include +#include +#include + +namespace csp::adapters::websocket +{ +using namespace csp::autogen; + +class ClientHeaderUpdateOutputAdapter final: public OutputAdapter +{ +public: + ClientHeaderUpdateOutputAdapter( + Engine * engine, + Dictionary& properties + ); + + void executeImpl() override; + + const char * name() const override { return "WebsocketClientHeaderUpdateAdapter"; } + +private: + Dictionary& m_properties; + +}; + +} + + +#endif \ No newline at end of file diff --git a/cpp/csp/adapters/websocket/ClientInputAdapter.cpp b/cpp/csp/adapters/websocket/ClientInputAdapter.cpp new file mode 100644 index 000000000..91fe230c1 --- /dev/null +++ b/cpp/csp/adapters/websocket/ClientInputAdapter.cpp @@ -0,0 +1,42 @@ +#include + +namespace csp::adapters::websocket +{ + +ClientInputAdapter::ClientInputAdapter( + Engine * engine, + CspTypePtr & type, + PushMode pushMode, + const Dictionary & properties +) : PushInputAdapter(engine, type, pushMode) +{ + if( type -> type() != CspType::Type::STRUCT && + type -> type() != CspType::Type::STRING ) + CSP_THROW( RuntimeException, "Unsupported type: " << type -> type() ); + + if( properties.exists( "meta_field_map" ) ) + { + const Dictionary & metaFieldMap = *properties.get( "meta_field_map" ); + + if( !metaFieldMap.empty() && type -> type() != CspType::Type::STRUCT ) + CSP_THROW( ValueError, "meta_field_map is not supported on non-struct types" ); + } + + m_converter = adapters::utils::MessageStructConverterCache::instance().create( type, properties ); +}; + +void ClientInputAdapter::processMessage( std::string payload, PushBatch* batch ) +{ + + if( type() -> type() == CspType::Type::STRUCT ) + { + auto tick = m_converter -> asStruct( &payload, payload.length() ); + pushTick( std::move(tick), batch ); + } else if ( type() -> type() == CspType::Type::STRING ) + { + pushTick( std::move(payload), batch ); + } + +} + +} \ No newline at end of file diff --git a/cpp/csp/adapters/websocket/ClientInputAdapter.h b/cpp/csp/adapters/websocket/ClientInputAdapter.h new file mode 100644 index 000000000..93711bbf6 --- /dev/null +++ b/cpp/csp/adapters/websocket/ClientInputAdapter.h @@ -0,0 +1,34 @@ +#ifndef _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_INPUTADAPTER_H +#define _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_INPUTADAPTER_H + +#include +#include +#include +#include +#include +#include + +namespace csp::adapters::websocket +{ + + +class ClientInputAdapter final: public PushInputAdapter { +public: + ClientInputAdapter( + Engine * engine, + CspTypePtr & type, + PushMode pushMode, + const Dictionary & properties + ); + + void processMessage( std::string payload, PushBatch* batch ); + +private: + adapters::utils::MessageStructConverterPtr m_converter; + +}; + +} + + +#endif // _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_INPUTADAPTER_H \ No newline at end of file diff --git a/cpp/csp/adapters/websocket/ClientOutputAdapter.cpp b/cpp/csp/adapters/websocket/ClientOutputAdapter.cpp new file mode 100644 index 000000000..48d2954dc --- /dev/null +++ b/cpp/csp/adapters/websocket/ClientOutputAdapter.cpp @@ -0,0 +1,17 @@ +#include + +namespace csp::adapters::websocket { + +ClientOutputAdapter::ClientOutputAdapter( + Engine * engine, + WebsocketEndpointBase * endpoint +) : OutputAdapter( engine ), m_endpoint( endpoint ) +{ }; + +void ClientOutputAdapter::executeImpl() +{ + const std::string & value = input() -> lastValueTyped(); + m_endpoint->send( value ); +}; + +} \ No newline at end of file diff --git a/cpp/csp/adapters/websocket/ClientOutputAdapter.h b/cpp/csp/adapters/websocket/ClientOutputAdapter.h new file mode 100644 index 000000000..64726837e --- /dev/null +++ b/cpp/csp/adapters/websocket/ClientOutputAdapter.h @@ -0,0 +1,35 @@ +#ifndef _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_OUTPUTADAPTER_H +#define _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_OUTPUTADAPTER_H + +#include +#include +#include +#include +#include + +namespace csp::adapters::websocket +{ + +class ClientAdapterManager; + +class ClientOutputAdapter final: public OutputAdapter +{ + +public: + ClientOutputAdapter( + Engine * engine, + WebsocketEndpointBase* endpoint + ); + + void executeImpl() override; + + const char * name() const override { return "WebsocketClientOutputAdapter"; } + +private: + WebsocketEndpointBase* m_endpoint; +}; + +} + + +#endif \ No newline at end of file diff --git a/cpp/csp/adapters/websocket/WebsocketEndpoint.cpp b/cpp/csp/adapters/websocket/WebsocketEndpoint.cpp new file mode 100644 index 000000000..46cb61468 --- /dev/null +++ b/cpp/csp/adapters/websocket/WebsocketEndpoint.cpp @@ -0,0 +1,189 @@ +#include + +using websocketpp::lib::placeholders::_1; +using websocketpp::lib::placeholders::_2; +using websocketpp::lib::bind; + +namespace csp::adapters::websocket { +using namespace csp; + +/* +WebsocketEndpointBase -> base setup +*/ +WebsocketEndpointBase::WebsocketEndpointBase( csp::Dictionary properties ) +: m_properties( properties ) +{ }; + +csp::Dictionary& WebsocketEndpointBase::getProperties() { + return m_properties; +} + +void WebsocketEndpointBase::setOnMessageCb(on_message_cb cb) +{ m_on_message=cb; } + +void WebsocketEndpointBase::setOnOpenCb(void_cb cb) +{ m_on_open=cb; } + +void WebsocketEndpointBase::setOnFailCb(void_cb cb) +{ m_on_fail=cb; } + +void WebsocketEndpointBase::setOnCloseCb(void_cb cb) +{ m_on_close=cb; } + +void WebsocketEndpointBase::setOnSendFailCb(on_send_fail_cb cb) +{ m_on_send_fail=cb; } + +/* +WebsocketEndpointTLS -> tls impl +*/ +WebsocketEndpointTLS::WebsocketEndpointTLS(csp::Dictionary properties) +: WebsocketEndpointBase( std::move(properties) ) +{ + if( m_properties.get("verbose_log") ) { + m_client.set_access_channels(websocketpp::log::alevel::all); + } else { + m_client.clear_access_channels(websocketpp::log::alevel::all); + } + m_client.init_asio(); + + // need to set these with callbacks + m_client.set_open_handler( [ this ]( websocketpp::connection_hdl ){ + m_on_open(); + }); + m_client.set_message_handler( [ this ]( websocketpp::connection_hdl, message_ptr msg ) { + m_on_message( msg -> get_payload() ); + }); + m_client.set_fail_handler( [ this ]( websocketpp::connection_hdl ){ + m_on_fail(); + }); + m_client.set_close_handler( [ this ]( websocketpp::connection_hdl ){ + m_on_close(); + }); + m_client.set_tls_init_handler( []( websocketpp::connection_hdl ){ + auto ctx = websocketpp::lib::make_shared(boost::asio::ssl::context::tlsv12); + boost::system::error_code ec; + ctx->set_options( + boost::asio::ssl::context::default_workarounds | + boost::asio::ssl::context::no_sslv2 | + boost::asio::ssl::context::single_dh_use, ec + ); + if( ec ) { + CSP_THROW( csp::RuntimeException, "Init tls failed: "<< ec ); + } + return ctx; + }); +} +WebsocketEndpointTLS::~WebsocketEndpointTLS() +{ } + +void WebsocketEndpointTLS::send( const std::string& s ) +{ + websocketpp::lib::error_code ec; + m_client.send( m_hdl, s, websocketpp::frame::opcode::value::TEXT, ec ); + if( ec ) m_on_send_fail(s); +} + +void WebsocketEndpointTLS::run() +{ + auto uri = m_properties.get("uri"); + websocketpp::lib::error_code ec; + tls_client::connection_ptr con = m_client.get_connection( uri, ec ); + if( ec ) { + CSP_THROW(RuntimeException, "could not create connection because: " << ec.message()); + } + const csp::Dictionary &headers = *m_properties.get("headers"); + + for( auto it = headers.begin(); it != headers.end(); ++it ) + { + const std::string key = it.key(); + const std::string value = headers.get( key ); + con.get() -> append_header( key, value ); + } + + m_client.connect( con ); + m_hdl = con -> get_handle(); + m_client.run(); + m_client.reset(); +} + +void WebsocketEndpointTLS::close() +{ + websocketpp::lib::error_code ec; + m_client.close( m_hdl , websocketpp::close::status::going_away, "", ec ); + if( ec ) { + CSP_THROW( RuntimeException, "could not close connection because: " << ec.message() ); + } +} + + +/* +WebsocketEndpointNoTLS -> tls impl +*/ +WebsocketEndpointNoTLS::WebsocketEndpointNoTLS( csp::Dictionary properties ) +: WebsocketEndpointBase( properties ) +{ + if (m_properties.get("verbose_log")) { + m_client.set_access_channels(websocketpp::log::alevel::all); + // m_client.clear_access_channels(websocketpp::log::alevel::frame_payload); + } else { + m_client.clear_access_channels(websocketpp::log::alevel::all); + } + m_client.init_asio(); + + // need to set these with callbacks + m_client.set_open_handler( [ this ]( websocketpp::connection_hdl ){ + m_on_open(); + }); + m_client.set_message_handler( [ this ]( websocketpp::connection_hdl, message_ptr msg ) { + m_on_message( msg -> get_payload() ); + }); + m_client.set_fail_handler( [ this ]( websocketpp::connection_hdl ){ + m_on_fail(); + }); + m_client.set_close_handler( [ this ]( websocketpp::connection_hdl ){ + m_on_close(); + }); +} +WebsocketEndpointNoTLS::~WebsocketEndpointNoTLS() +{ } + +void WebsocketEndpointNoTLS::send( const std::string& s ) +{ + websocketpp::lib::error_code ec; + m_client.send( m_hdl, s, websocketpp::frame::opcode::value::TEXT, ec ); + if( ec ) m_on_send_fail( s ); +} + +void WebsocketEndpointNoTLS::run() +{ + auto uri = m_properties.get( "uri" ); + websocketpp::lib::error_code ec; + client::connection_ptr con = m_client.get_connection( uri, ec ); + if(ec) { + CSP_THROW( RuntimeException, "could not create connection because: " << ec.message() ); + } + const csp::Dictionary &headers = *m_properties.get("headers"); + + for( auto it = headers.begin(); it != headers.end(); ++it ) + { + const std::string key = it.key(); + const std::string value = headers.get( key ); + con.get() -> append_header( key, value ); + } + + m_client.connect( con ); + m_hdl = con -> get_handle(); + m_client.run(); + m_client.reset(); +} + +void WebsocketEndpointNoTLS::close() +{ + websocketpp::lib::error_code ec; + m_client.close( m_hdl, websocketpp::close::status::going_away, "Good bye", ec ); + if( ec ) { + CSP_THROW( RuntimeException, "could not close connection because: " << ec.message() ); + } +} + +} \ No newline at end of file diff --git a/cpp/csp/adapters/websocket/WebsocketEndpoint.h b/cpp/csp/adapters/websocket/WebsocketEndpoint.h new file mode 100644 index 000000000..e4b1e095f --- /dev/null +++ b/cpp/csp/adapters/websocket/WebsocketEndpoint.h @@ -0,0 +1,84 @@ +#ifndef _IN_CSP_ADAPTERS_WEBSOCKETS_ENDPOINT_H +#define _IN_CSP_ADAPTERS_WEBSOCKETS_ENDPOINT_H + +// need a base -> TLS, base -> No TLS +#include +#include +#include +#include +#include + +namespace csp::adapters::websocket { + +using on_message_cb = std::function; +using on_send_fail_cb = std::function; +using void_cb = std::function; + +using message_ptr = websocketpp::config::core_client::message_type::ptr; + + +class WebsocketEndpointBase { +public: + WebsocketEndpointBase(csp::Dictionary properties); + virtual ~WebsocketEndpointBase() { }; + + virtual void run() { }; + virtual void send(const std::string&){ }; + virtual void close() { }; + + void setOnMessageCb(on_message_cb cb); + void setOnOpenCb(void_cb cb); + void setOnFailCb(void_cb cb); + void setOnCloseCb(void_cb cb); + void setOnSendFailCb(on_send_fail_cb cb); + + csp::Dictionary& getProperties(); + +public: + csp::Dictionary m_properties; + void_cb m_on_open; + on_message_cb m_on_message; + void_cb m_on_fail; + void_cb m_on_close; + on_send_fail_cb m_on_send_fail; + +}; + + +class WebsocketEndpointTLS final: public WebsocketEndpointBase { + +using tls_client = websocketpp::client; + +public: + WebsocketEndpointTLS(const csp::Dictionary properties); + ~WebsocketEndpointTLS(); + + void run() override; + void send(const std::string& s) override; + void close() override; + +private: + tls_client m_client; + websocketpp::connection_hdl m_hdl; +}; + + +class WebsocketEndpointNoTLS final: public WebsocketEndpointBase { + +using client = websocketpp::client; + +public: + WebsocketEndpointNoTLS(csp::Dictionary properties); + ~WebsocketEndpointNoTLS(); + + void run() override; + void send(const std::string& s) override; + void close() override; + +private: + client m_client; + websocketpp::connection_hdl m_hdl; +}; +} + +#endif \ No newline at end of file diff --git a/cpp/csp/python/adapters/CMakeLists.txt b/cpp/csp/python/adapters/CMakeLists.txt index e44630320..a44cd8d38 100644 --- a/cpp/csp/python/adapters/CMakeLists.txt +++ b/cpp/csp/python/adapters/CMakeLists.txt @@ -33,3 +33,9 @@ if(CSP_BUILD_PARQUET_ADAPTER) target_include_directories(parquetadapterimpl PUBLIC ${ARROW_INCLUDE_DIR} ${PARQUET_INCLUDE_DIR} "${VENDORED_PYARROW_ROOT}") install(TARGETS parquetadapterimpl RUNTIME DESTINATION bin/ LIBRARY DESTINATION lib/) endif() + +if(CSP_BUILD_WS_CLIENT_ADAPTER) + add_library(websocketadapterimpl SHARED websocketadapterimpl.cpp) + target_link_libraries(websocketadapterimpl csp_core csp_engine cspimpl csp_websocket_client_adapter) + install(TARGETS websocketadapterimpl RUNTIME DESTINATION bin/ LIBRARY DESTINATION lib/) +endif() diff --git a/cpp/csp/python/adapters/websocketadapterimpl.cpp b/cpp/csp/python/adapters/websocketadapterimpl.cpp new file mode 100644 index 000000000..d636932da --- /dev/null +++ b/cpp/csp/python/adapters/websocketadapterimpl.cpp @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace csp::adapters::websocket; + +namespace csp::python +{ + +using namespace csp; +using namespace csp::python; + +//AdapterManager +csp::AdapterManager * create_websocket_adapter_manager( PyEngine * engine, const Dictionary & properties ) +{ + return engine -> engine() -> createOwnedObject( properties ); +} + +static InputAdapter * create_websocket_input_adapter( csp::AdapterManager * manager, PyEngine * pyengine, PyObject * pyType, PushMode pushMode, PyObject * args ) +{ + auto & cspType = pyTypeAsCspType( pyType ); + + PyObject * pyProperties; + PyObject * type; + auto * websocketManager = dynamic_cast( manager ); + if( !websocketManager ) + CSP_THROW( TypeError, "Expected WebsocketClientAdapterManager" ); + + if( !PyArg_ParseTuple( args, "O!O!", + &PyType_Type, &type, + &PyDict_Type, &pyProperties ) ) + CSP_THROW( PythonPassthrough, "" ); + + return websocketManager -> getInputAdapter( cspType, pushMode, fromPython( pyProperties ) ); +} + +static OutputAdapter * create_websocket_output_adapter( csp::AdapterManager * manager, PyEngine * pyengine, PyObject * args ) +{ + auto * websocketManager = dynamic_cast( manager ); + if( !websocketManager ) + CSP_THROW( TypeError, "Expected WebsocketClientAdapterManager" ); + return websocketManager -> getOutputAdapter(); +} + +static OutputAdapter * create_websocket_header_update_adapter( csp::AdapterManager * manager, PyEngine * pyengine, PyObject * args ) +{ + auto * websocketManager = dynamic_cast( manager ); + if( !websocketManager ) + CSP_THROW( TypeError, "Expected WebsocketClientAdapterManager" ); + return websocketManager -> getHeaderUpdateAdapter(); +} + +REGISTER_ADAPTER_MANAGER( _websocket_adapter_manager, create_websocket_adapter_manager ); +REGISTER_INPUT_ADAPTER( _websocket_input_adapter, create_websocket_input_adapter ); +REGISTER_OUTPUT_ADAPTER( _websocket_output_adapter, create_websocket_output_adapter ); +REGISTER_OUTPUT_ADAPTER( _websocket_header_update_adapter, create_websocket_header_update_adapter); + +static PyModuleDef _websocketadapterimpl_module = { + PyModuleDef_HEAD_INIT, + "_websocketadapterimpl", + "_websocketadapterimpl c++ module", + -1, + NULL, NULL, NULL, NULL, NULL +}; + +PyMODINIT_FUNC PyInit__websocketadapterimpl(void) +{ + PyObject* m; + + m = PyModule_Create( &_websocketadapterimpl_module); + if( m == NULL ) + return NULL; + + if( !InitHelper::instance().execute( m ) ) + return NULL; + + return m; +} + +} diff --git a/csp/adapters/websocket.py b/csp/adapters/websocket.py index cad4b35cc..222fd7b0c 100644 --- a/csp/adapters/websocket.py +++ b/csp/adapters/websocket.py @@ -4,11 +4,35 @@ import typing import urllib from collections import defaultdict -from datetime import date, datetime +from datetime import date, datetime, timedelta +from typing import Dict, List import csp from csp import ts +from csp.adapters.status import Status +from csp.adapters.utils import ( + BytesMessageProtoMapper, + DateTimeType, + JSONTextMessageMapper, + MsgMapper, + RawBytesMessageMapper, + RawTextMessageMapper, +) +from csp.impl.wiring import input_adapter_def, output_adapter_def, status_adapter_def from csp.impl.wiring.delayed_node import DelayedNodeWrapperDef +from csp.lib import _websocketadapterimpl + +from .websocket_types import WebsocketHeaderUpdate + +_ = ( + BytesMessageProtoMapper, + DateTimeType, + JSONTextMessageMapper, + RawBytesMessageMapper, + RawTextMessageMapper, +) +T = typing.TypeVar("T") + try: import tornado.ioloop @@ -355,3 +379,91 @@ def _instantiate(self): _apply_updates(manager, table_name, table.columns) _launch_application(self._port, manager, csp.const("stub")) + + +class WebsocketAdapterManager: + def __init__( + self, + uri: str, + verbose_log: bool = False, + reconnect_interval: timedelta = timedelta(seconds=2), + headers: Dict[str, str] = None, + ): + """ + uri: str + where to connect + verbose_log: bool = False + should the websocket client also log using the builtin + reconnect_interval: timedelta = timedelta(seconds=2) + time interval to wait before trying to reconnect (must be >= 1 second) + headers: Dict[str, str] = None + headers to apply to the request during the handshake + """ + assert reconnect_interval >= timedelta(seconds=1) + self._properties = dict( + uri=uri, + verbose_log=verbose_log, + reconnect_interval=reconnect_interval, + headers=headers if headers else {}, + use_tls=uri.startswith("wss"), + ) + + def subscribe( + self, + ts_type: type, + msg_mapper: MsgMapper, + field_map: typing.Union[dict, str] = None, + meta_field_map: dict = None, + push_mode: csp.PushMode = csp.PushMode.NON_COLLAPSING, + ): + field_map = field_map or {} + meta_field_map = meta_field_map or {} + if isinstance(field_map, str): + field_map = {field_map: ""} + + if not field_map and issubclass(ts_type, csp.Struct): + field_map = ts_type.default_field_map() + + properties = msg_mapper.properties.copy() + properties["field_map"] = field_map + properties["meta_field_map"] = meta_field_map + + return _websocket_input_adapter_def(self, ts_type, properties, push_mode) + + def send(self, x: ts["T"]): + return _websocket_output_adapter_def(self, x) + + def update_headers(self, x: ts[List[str]]): + return _websocket_header_update_adapter_def(self, x) + + def status(self, push_mode=csp.PushMode.NON_COLLAPSING): + ts_type = Status + return status_adapter_def(self, ts_type, push_mode) + + def _create(self, engine, memo): + """method needs to return the wrapped c++ adapter manager""" + return _websocketadapterimpl._websocket_adapter_manager(engine, self._properties) + + +_websocket_input_adapter_def = input_adapter_def( + "websocket_input_adapter", + _websocketadapterimpl._websocket_input_adapter, + ts["T"], + WebsocketAdapterManager, + typ="T", + properties=dict, +) + +_websocket_output_adapter_def = output_adapter_def( + "websocket_output_adapter", + _websocketadapterimpl._websocket_output_adapter, + WebsocketAdapterManager, + input=ts["T"], +) + +_websocket_header_update_adapter_def = output_adapter_def( + "websocket_header_update_adapter", + _websocketadapterimpl._websocket_header_update_adapter, + WebsocketAdapterManager, + input=ts[List[WebsocketHeaderUpdate]], +) diff --git a/csp/adapters/websocket_types.py b/csp/adapters/websocket_types.py new file mode 100644 index 000000000..710610501 --- /dev/null +++ b/csp/adapters/websocket_types.py @@ -0,0 +1,17 @@ +from csp.impl.enum import Enum +from csp.impl.struct import Struct + +CSP_AUTOGEN_HINTS = {"cpp_header": "csp/adapters/websocket/websocket_types.h"} + + +class WebsocketStatus(Enum): + ACTIVE = 0 + GENERIC_ERROR = 1 + CONNECTION_FAILED = 2 + CLOSED = 3 + MESSAGE_SEND_FAIL = 4 + + +class WebsocketHeaderUpdate(Struct): + key: str + value: str diff --git a/csp/impl/wiring/numba_node.py b/csp/impl/wiring/numba_node.py index 0f2fc9c52..a6ad5bfe6 100644 --- a/csp/impl/wiring/numba_node.py +++ b/csp/impl/wiring/numba_node.py @@ -67,17 +67,17 @@ def _create(self, engine, memo): exposed_utility_values = {} cache_key = [self._impl] for (ts_idx, basket_idx), input in self.ts_inputs(): - exposed_utility_values[ - NumbaNodeParser.get_ts_input_value_getter_name(ts_idx) - ] = NumbaTSTypedFunctionResolver.get_value_getter_function(input.tstype.typ) + exposed_utility_values[NumbaNodeParser.get_ts_input_value_getter_name(ts_idx)] = ( + NumbaTSTypedFunctionResolver.get_value_getter_function(input.tstype.typ) + ) cache_key.append(input.tstype) for output in self._outputs: assert output.kind.is_single_ts() ts_idx = output.ts_idx - exposed_utility_values[ - NumbaNodeParser.get_ts_out_value_return_name(ts_idx) - ] = NumbaTSTypedFunctionResolver.get_value_returner_function(output.typ.typ) + exposed_utility_values[NumbaNodeParser.get_ts_out_value_return_name(ts_idx)] = ( + NumbaTSTypedFunctionResolver.get_value_returner_function(output.typ.typ) + ) numba_scalar_types = [] for i in self._signature.raw_inputs(): diff --git a/examples/3_using_adapters/websocket_client.py b/examples/3_using_adapters/websocket_client.py new file mode 100644 index 000000000..124a3169e --- /dev/null +++ b/examples/3_using_adapters/websocket_client.py @@ -0,0 +1,33 @@ +import sys +from datetime import datetime, timedelta + +import csp +from csp.adapters.websocket import RawTextMessageMapper, Status, WebsocketAdapterManager + + +@csp.node +def send_message_on_connection(s: csp.ts[Status], msg: str) -> csp.ts[str]: + # once the websocket adapter has connected, send a message to the server + if csp.ticked(s) and s.status_code == 0: + return msg + + +@csp.graph +def g(uri: str): + print("Trying to connect to", uri) + ws = WebsocketAdapterManager(uri) + msgs = ws.subscribe(str, RawTextMessageMapper()) + status = ws.status() + ws.send(send_message_on_connection(status, "Hello, World!")) + csp.print("status", status) + csp.print("received", msgs) + + +if __name__ == "__main__": + csp.run( + g, + starttime=datetime.utcnow(), + endtime=timedelta(minutes=1), + realtime=True, + uri=sys.argv[1], + ) diff --git a/setup.py b/setup.py index ab8cc2f08..538d813c4 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ ("CSP_MANYLINUX", "0"), ("CSP_BUILD_KAFKA_ADAPTER", "1"), ("CSP_BUILD_PARQUET_ADAPTER", "1"), + ("CSP_BUILD_WS_CLIENT_ADAPTER", "1"), # NOTE: # - omit vcpkg, need to test for presence # - omit ccache, need to test for presence @@ -58,7 +59,7 @@ if "CXX" in os.environ: cmake_args.append(f"-DCMAKE_CXX_COMPILER={os.environ['CXX']}") - + if "DEBUG" in os.environ: cmake_args.append("-DCMAKE_BUILD_TYPE=Debug") diff --git a/vcpkg.json b/vcpkg.json index dc5a28892..e45b4a9d9 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -17,7 +17,8 @@ "protobuf", "rapidjson", "thrift", - "utf8proc" + "utf8proc", + "websocketpp" ], "overrides": [ { "name": "arrow", "version": "15.0.0"}