-
Notifications
You must be signed in to change notification settings - Fork 447
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presuming no code changes since the last PR on the old repo and that it isn't wired in to the build yet, I'm good.
clients/cpp/README.md
Outdated
|
||
This folder contains a C++ client for ASP.NET Core SignalR. | ||
|
||
**This is an experimental project right now** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make it even clearer and add "There are no plans to ship this client at this time"
@@ -0,0 +1,148 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<ItemGroup Label="ProjectConfigurations"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<VCProjectVersion>15.0</VCProjectVersion> | ||
<ProjectGuid>{BEC3FEA2-DD32-4B55-B27F-64A5F3DBBB46}</ProjectGuid> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flashbacks D:
|
So we don't need the other repo? |
Correct, but I still need to copy the issues over before you delete it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think you would get further and quicker if you take the old client and remove things that are not needed.
Also, you will get quite a lot of test coverage for free.
@@ -0,0 +1,148 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at files in folder here: https://github.com/SignalR/SignalR-Client-Cpp/tree/dev/Build - they help avoid duplication. I don't want to go too far but I think you will want to copy a lot of this. Not only because they worked but they also use compiler settings required/recommended by security folks.
web::http::client::http_client client(url); | ||
|
||
web::http::http_request request; | ||
request.set_method(L"POST"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think cross plat from the very beginning or you will have a lot of work later. Start from using _XPLATSTR
or _U
for string literals
{ | ||
mUrl = url; | ||
mTransport = new WebSocketsTransport(mUrl); | ||
mTransport->OnReceived([&](const utility::string_t& messages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't capture like this - this will crash very hard. I did not read the code very carefully but I think this lambda can outlive the connection and all your m* variables will cause segfaults. There is a reason while the old SignalR C++ client used shared_ptr all over the place (https://github.com/SignalR/SignalR-Client-Cpp/blob/dev/src/signalrclient/connection_impl.cpp#L96). Read more on this in my post https://blog.3d-logic.com/2014/12/28/c-async-development-not-only-for-for-c-developers-part-ii-lambda-functions-the-most-common-pitfalls/
(because you are using Casablanca consider reading entire series: https://blog.3d-logic.com/category/cpprestsdk/ - it is basically my learnings from writing the SignalR client. Sadly, I have never written the last two posts).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm going to be using shared_ptr later, this was a quick, get things working
} | ||
else | ||
{ | ||
//??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw - invalid URL
@@ -0,0 +1,4 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<packages> | |||
<package id="cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn" version="2.9.1" targetFramework="native" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dat package name.
@@ -0,0 +1,34 @@ | |||
// Copyright (c) .NET Foundation. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the ClientSample folder pascal case?
@@ -0,0 +1,35 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why signalrlib and not lib or just signalr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually should be libsignalr for mac and linux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve the third-party-notices change.
A lot of files are missing a copyright header |
BOOM! |
Which files are missing copyright? |
A saw in a quick scan: clients/cpp/samples/HubConnectionSample/HubConnectionSample.cpp |
I guess we can put copyright in samples... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-signing off on licenses. Thanks 😄
100% not related to this PR, but still interesting
|
@BrennanConroy we're on a thread with the BCL about this. |
Move Cpp Client to main repo (#1703)
No description provided.