Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the SignalR C++ client to be built without using cpprestsdk #8718

Closed
analogrelay opened this issue Mar 21, 2019 · 8 comments · Fixed by aspnet/SignalR-Client-Cpp#24
Closed
Assignees
Labels
area-signalr Includes: SignalR clients and servers enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-client-c++ Related to the SignalR C++ client

Comments

@analogrelay
Copy link
Contributor

analogrelay commented Mar 21, 2019

Epic #5301

We have customers interested in using SignalR with a different backend networking stack. We'll provide abstractions (http_client, websocket_client, etc.) and use cpprestsdk to provide default implementations but we should have a #define that can be used to strip those default implementations so that they aren't in the binary when they aren't being used.

@analogrelay analogrelay added area-signalr Includes: SignalR clients and servers feature-client-c++ Related to the SignalR C++ client release-3.0 labels Mar 21, 2019
@analogrelay analogrelay changed the title Allow the SignalR C++ to be built without using cpprestsdk Allow the SignalR C++ client to be built without using cpprestsdk Mar 21, 2019
@analogrelay analogrelay added this to the 3.0.0-preview5 milestone Mar 21, 2019
@BrennanConroy BrennanConroy self-assigned this Mar 22, 2019
@analogrelay
Copy link
Contributor Author

Triage decision: C++ tidy up item, not the priority for preview 5.

@analogrelay analogrelay added enhancement This issue represents an ask for new feature or an enhancement to an existing one and removed 2 - Working labels May 7, 2019
@analogrelay analogrelay modified the milestones: 3.0.0-preview7, Backlog May 30, 2019
@analogrelay
Copy link
Contributor Author

Let's see about getting this done in Preview 8

@analogrelay analogrelay modified the milestones: Backlog, 3.0.0-preview8 Jun 12, 2019
@BrennanConroy
Copy link
Member

FYI, this involves doing something about Json. One thought is to copy the source from cpprestsdk and clean it up a little (namespaces etc.). Then we can delay the refactored public API for adding SignalRDOM and keep Json on the API.

Or we can find a different Json library to use instead.

@BrennanConroy
Copy link
Member

microsoft/terminal recently started using jsoncpp. We should look at also using that library.

@mmarinchenko
Copy link

Hi guys! Just for the info :)

  1. connection_impl.cpp still uses _XPLATSTR and utility::conversions::to_string_t() in the following string:
headers[_XPLATSTR("Authorization")] = utility::conversions::to_string_t("Bearer " + response.accessToken);
  1. negotiate.cpp still uses utility::conversions::to_utf8string() in the following string:
request.headers.insert(std::make_pair(utility::conversions::to_utf8string(header.first), utility::conversions::to_utf8string(header.second)));

Both of these are not compiled without cpprestsdk even if (and when :)) the alternative http and websocket clients are provided. As I can see some code must be added to copied cpprestsdk/utility.h file.

@BrennanConroy
Copy link
Member

if (and when :)) the alternative http and websocket clients are provided

Just to clarify, we are not providing an alternative http and websocket client.
We are providing the option for users to replace the http and websocket client with a custom one that may be platform specific.

@mmarinchenko
Copy link

@BrennanConroy

Yes, I understand this, thanks.

The reason why I wrote my comment above is you copied some code from cpprestsdk to have uri_builder, scan_string(), etc. even with alternative http and websocket client implementations.

But you copied neither _XPLATSTR, to_string_t() and to_utf8string() implementations nor wrap the code which use all this by #ifdef USE_CPPRESTSDK ... #endif condition.

@BrennanConroy
Copy link
Member

Yep, that's because the work is still in progress and we still need to replace the headers with a normal map of <std::string, std::string>.

@BrennanConroy BrennanConroy modified the milestones: 5.0.0, 5.0.0-preview1 Feb 5, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-signalr Includes: SignalR clients and servers enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-client-c++ Related to the SignalR C++ client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants