-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Added withServerTimeout and withKeepAliveInterval to HubConnectionBuilder for java client #46172
Conversation
…lder for java client
@@ -23,6 +23,8 @@ public class HttpHubConnectionBuilder { | |||
private Map<String, String> headers; | |||
private TransportEnum transportEnum; | |||
private Action1<OkHttpClient.Builder> configureBuilder; | |||
private Long serverTimeout; |
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 use the object Long
instead of the primitive long
? It also adds unnecessary Object.nonNull
code to HubConnection
and we're storing it as long
anyways.
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.
The reason for that is the following.
If I used primitive long
and withServerTimeout
wasn't called in HubConnectionBuilder
then default value 0 would be passed to HubConnection
constructor and there would be a need to check that serverTimeout
is not 0. But what if there would be a case when you want to set serverTimeout
to 0. That is why I decided to use Long
so that default value would be null
and I would check for null
in the HubConnection
constructor.
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.
Give the values a default so they won't be 0 if not set.
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.
Done
.../clients/java/signalr/core/src/main/java/com/microsoft/signalr/HttpHubConnectionBuilder.java
Outdated
Show resolved
Hide resolved
.../clients/java/signalr/core/src/main/java/com/microsoft/signalr/HttpHubConnectionBuilder.java
Outdated
Show resolved
Hide resolved
…oft/signalr/HttpHubConnectionBuilder.java Co-authored-by: Brennan <brecon@microsoft.com>
…oft/signalr/HttpHubConnectionBuilder.java Co-authored-by: Brennan <brecon@microsoft.com>
…lder for java client (dotnet#46172) * Added withServerTimeout and withKeepAliveInterval to HubConnectionBuilder for java client
Added withServerTimeout and withKeepAliveInterval to HubConnectionBuilder for java client
Partially fixes #44742