Added withServerTimeout and withKeepAliveInterval to HubConnectionBuilder for java client#46172
Conversation
…lder for java client
| private Map<String, String> headers; | ||
| private TransportEnum transportEnum; | ||
| private Action1<OkHttpClient.Builder> configureBuilder; | ||
| private Long serverTimeout; |
There was a problem hiding this comment.
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.
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.
Give the values a default so they won't be 0 if not set.
…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