Skip to content

Commit 547d719

Browse files
Get CI building again (#103)
1 parent 7cce972 commit 547d719

16 files changed

+55
-23
lines changed

.azure/default-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
enableTelemetry: true
2424
pool:
2525
${{ if eq(parameters.agentOs, 'macOS') }}:
26-
vmImage: macOS-12
26+
vmImage: macOS-latest
2727
${{ if eq(parameters.agentOs, 'Linux') }}:
28-
vmImage: ubuntu-20.04
28+
vmImage: ubuntu-latest
2929
${{ if eq(parameters.agentOs, 'Windows') }}:
30-
vmImage: windows.vs2019.amd64
30+
vmImage: windows-latest
3131
steps:
3232
- checkout: self
3333
clean: true

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ if(NOT WIN32)
1616
set(EXTRA_FLAGS "-std=c++11 -fPIC -DNO_SIGNALRCLIENT_EXPORTS")
1717
else()
1818
set(EXTRA_FLAGS "-DSIGNALRCLIENT_EXPORTS")
19+
# cpprestsdk hasn't updated to fix these warnings
20+
string(APPEND EXTRA_FLAGS " -D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING")
1921
endif()
2022

2123
if(USE_MSGPACK)
@@ -45,8 +47,8 @@ set(JSONCPP_LIB "jsoncpp_static" CACHE STRING "jsoncpp target name")
4547
endif()
4648

4749
if(USE_MSGPACK)
48-
find_package(msgpack CONFIG REQUIRED)
49-
set(MSGPACK_LIB "msgpackc-cxx")
50+
find_package(msgpack-cxx CONFIG REQUIRED)
51+
set(MSGPACK_LIB "msgpack-cxx")
5052
endif()
5153

5254
include_directories (include)

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ Use https://github.com/aspnet/AspNetCore/issues for issues with this project.
66

77
## Install this library
88

9+
> [!WARNING]
10+
> Websockets are currently disabled which means the client will fail to connect to a SignalR server.
11+
> Workaround by providing a custom websocket client implementation and using it via `builder.with_websocket_factory(...)`.
12+
> A new websocket implementation will be provided in-box in a future commit.
13+
914
There are multiple ways to build this library
1015

11-
* Use [vcpkg](https://github.com/microsoft/vcpkg) and install the library with `vcpkg install microsoft-signalr`
16+
* **Currently missing due to websocket issues.** ~~Use [vcpkg](https://github.com/microsoft/vcpkg) and install the library with `vcpkg install microsoft-signalr`~~
1217
* Build from [command line](#command-line-build)
1318
* Build in Visual Studio (must have the "Desktop Development with C++" workload) by selecting the "Open a local folder" option and selecting the repository root folder
1419

@@ -21,7 +26,7 @@ Below are instructions to build on different OS's. You can also use the followin
2126
| -DBUILD_SAMPLES | Build the included sample project | false |
2227
| -DBUILD_TESTING | Builds the test project | true |
2328
| -DUSE_CPPRESTSDK | Includes the CppRestSDK (default http stack) (requires cpprestsdk to be installed) | false |
24-
| -DUSE_MSGPACK | Adds an option to use the MessagePack Hub Protocol (requires msgpack-c to be installed) | false |
29+
| -DUSE_MSGPACK | Adds an option to use the MessagePack Hub Protocol (requires msgpack to be installed, e.g. `vcpkg install msgpack:x64-windows`) | false |
2530
| -DWERROR | Enables warnings as errors | true |
2631
| -DWALL | Enables all warnings | true |
2732
| -DINJECT_HEADER_AFTER_STDAFX=`<header path>` | Adds the provided header to the library compilation in stdafx.cpp, intended to allow "new" and "delete" to be replaced. | `<none>` |
@@ -30,7 +35,7 @@ Below are instructions to build on different OS's. You can also use the followin
3035
```powershell
3136
PS> git submodule update --init
3237
PS> .\submodules\vcpkg\bootstrap-vcpkg.bat
33-
PS> .\submodules\vcpkg\vcpkg.exe install cpprestsdk[websockets]:x64-windows jsoncpp:x64-windows
38+
PS> .\submodules\vcpkg\vcpkg.exe install cpprestsdk:x64-windows jsoncpp:x64-windows
3439
PS> mkdir build.release
3540
PS> cd build.release
3641
PS> cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE="..\submodules\vcpkg\scripts\buildsystems\vcpkg.cmake" -DCMAKE_BUILD_TYPE=Release -DUSE_CPPRESTSDK=true
@@ -43,7 +48,7 @@ Output will be in `build.release\bin\Release\`
4348
$ git submodule update --init
4449
$ brew install gcc6
4550
$ ./submodules/vcpkg/bootstrap-vcpkg.sh
46-
$ ./submodules/vcpkg/vcpkg install cpprestsdk[websockets] jsoncpp
51+
$ ./submodules/vcpkg/vcpkg install cpprestsdk jsoncpp
4752
$ mkdir build.release
4853
$ cd build.release
4954
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../submodules/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DUSE_CPPRESTSDK=true
@@ -56,7 +61,7 @@ Output will be in `build.release/bin/`
5661
```bash
5762
$ git submodule update --init
5863
$ ./submodules/vcpkg/bootstrap-vcpkg.sh
59-
$ ./submodules/vcpkg/vcpkg install cpprestsdk[websockets] boost-system boost-chrono boost-thread jsoncpp
64+
$ ./submodules/vcpkg/vcpkg install cpprestsdk boost-system boost-chrono boost-thread jsoncpp
6065
$ mkdir build.release
6166
$ cd build.release
6267
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../submodules/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DUSE_CPPRESTSDK=true
@@ -74,7 +79,11 @@ Output will be in `build.release/bin/`
7479
#include "signalrclient/signalr_value.h"
7580

7681
std::promise<void> start_task;
77-
signalr::hub_connection connection = signalr::hub_connection_builder::create("http://localhost:5000/hub").build();
82+
signalr::hub_connection connection = signalr::hub_connection_builder::create("http://localhost:5000/hub")
83+
//.with_messagepack_hub_protocol()
84+
//.with_websocket_factory(...)
85+
//.with_http_client_factory(...)
86+
.build();
7887

7988
connection.on("Echo", [](const std::vector<signalr::value>& m)
8089
{

azure-pipelines-public.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ stages:
3434
- powershell: "& ./submodules/vcpkg/bootstrap-vcpkg.bat"
3535
condition: ne(variables.CACHE_RESTORED, 'true')
3636
displayName: Bootstrap vcpkg
37-
- powershell: "& ./submodules/vcpkg/vcpkg.exe install cpprestsdk[websockets]:x64-windows msgpack:x64-windows jsoncpp:x64-windows --vcpkg-root ./submodules/vcpkg"
37+
- powershell: "& ./submodules/vcpkg/vcpkg.exe install cpprestsdk:x64-windows msgpack:x64-windows jsoncpp:x64-windows --vcpkg-root ./submodules/vcpkg"
3838
condition: ne(variables.CACHE_RESTORED, 'true')
3939
displayName: vcpkg install dependencies
4040

@@ -47,7 +47,7 @@ stages:
4747
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh --allowAppleClang"
4848
condition: ne(variables.CACHE_RESTORED, 'true')
4949
displayName: Bootstrap vcpkg
50-
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk[websockets] msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
50+
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
5151
condition: ne(variables.CACHE_RESTORED, 'true')
5252
displayName: vcpkg install dependencies
5353

@@ -60,7 +60,7 @@ stages:
6060
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh"
6161
condition: ne(variables.CACHE_RESTORED, 'true')
6262
displayName: Bootstrap vcpkg
63-
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk[websockets] boost-system boost-chrono boost-thread msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
63+
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk boost-system boost-chrono boost-thread msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
6464
condition: ne(variables.CACHE_RESTORED, 'true')
6565
displayName: vcpkg install dependencies
6666
- bash: "sudo apt-get update && sudo apt install valgrind"

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extends:
5656
- powershell: "& ./submodules/vcpkg/bootstrap-vcpkg.bat"
5757
condition: ne(variables.CACHE_RESTORED, 'true')
5858
displayName: Bootstrap vcpkg
59-
- powershell: "& ./submodules/vcpkg/vcpkg.exe install cpprestsdk[websockets]:x64-windows msgpack:x64-windows jsoncpp:x64-windows --vcpkg-root ./submodules/vcpkg"
59+
- powershell: "& ./submodules/vcpkg/vcpkg.exe install cpprestsdk:x64-windows msgpack:x64-windows jsoncpp:x64-windows --vcpkg-root ./submodules/vcpkg"
6060
condition: ne(variables.CACHE_RESTORED, 'true')
6161
displayName: vcpkg install dependencies
6262

@@ -69,7 +69,7 @@ extends:
6969
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh --allowAppleClang"
7070
condition: ne(variables.CACHE_RESTORED, 'true')
7171
displayName: Bootstrap vcpkg
72-
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk[websockets] msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
72+
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
7373
condition: ne(variables.CACHE_RESTORED, 'true')
7474
displayName: vcpkg install dependencies
7575

@@ -82,7 +82,7 @@ extends:
8282
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh"
8383
condition: ne(variables.CACHE_RESTORED, 'true')
8484
displayName: Bootstrap vcpkg
85-
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk[websockets] boost-system boost-chrono boost-thread msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
85+
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk boost-system boost-chrono boost-thread msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
8686
condition: ne(variables.CACHE_RESTORED, 'true')
8787
displayName: vcpkg install dependencies
8888
- bash: "sudo apt-get update && sudo apt install valgrind"

include/signalrclient/signalr_client_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ namespace signalr
3434
SIGNALRCLIENT_API web::http::client::http_client_config __cdecl get_http_client_config() const;
3535
SIGNALRCLIENT_API void __cdecl set_http_client_config(const web::http::client::http_client_config& http_client_config);
3636

37+
#if false
3738
SIGNALRCLIENT_API web::websockets::client::websocket_client_config __cdecl get_websocket_client_config() const noexcept;
3839
SIGNALRCLIENT_API void __cdecl set_websocket_client_config(const web::websockets::client::websocket_client_config& websocket_client_config);
40+
#endif
3941
#endif
4042

4143
SIGNALRCLIENT_API signalr_client_config();
@@ -55,7 +57,9 @@ namespace signalr
5557
private:
5658
#ifdef USE_CPPRESTSDK
5759
web::http::client::http_client_config m_http_client_config;
60+
#if false
5861
web::websockets::client::websocket_client_config m_websocket_client_config;
62+
#endif
5963
#endif
6064
std::map<std::string, std::string> m_http_headers;
6165
std::shared_ptr<scheduler> m_scheduler;

include/signalrclient/signalr_value.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ namespace signalr
208208

209209
union storage
210210
{
211+
#pragma warning (push)
212+
#pragma warning (disable: 4582)
211213
bool boolean;
212214
std::string string;
213215
std::vector<value> array;
@@ -218,8 +220,7 @@ namespace signalr
218220
// constructor of types in union are not implicitly called
219221
// this is expected as we only construct a single type in the union once we know
220222
// what that type is when constructing the signalr_value type.
221-
#pragma warning (push)
222-
#pragma warning (disable: 4582)
223+
223224
storage() {}
224225
#pragma warning (pop)
225226

src/signalrclient/connection_impl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ namespace signalr
4646
if (websocket_factory == nullptr)
4747
{
4848
#ifdef USE_CPPRESTSDK
49+
#if false
4950
websocket_factory = [](const signalr_client_config& signalr_client_config) { return std::make_shared<default_websocket_client>(signalr_client_config); };
51+
#endif
5052
#endif
5153
}
5254

src/signalrclient/default_websocket_client.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "stdafx.h"
66

7+
#if false
78
#ifdef USE_CPPRESTSDK
89
#include "default_websocket_client.h"
910
#include <cpprest/producerconsumerstream.h>
@@ -122,4 +123,5 @@ namespace signalr
122123
});
123124
}
124125
}
126+
#endif
125127
#endif

src/signalrclient/default_websocket_client.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#pragma once
66

7+
#if false
78
#ifdef USE_CPPRESTSDK
89

910
#pragma warning (push)
@@ -29,4 +30,5 @@ namespace signalr
2930
};
3031
}
3132

33+
#endif
3234
#endif

0 commit comments

Comments
 (0)