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

ServerTimeout #6885

Closed
mmfarahat opened this issue Jun 5, 2018 — with docs.microsoft.com · 5 comments
Closed

ServerTimeout #6885

mmfarahat opened this issue Jun 5, 2018 — with docs.microsoft.com · 5 comments
Labels
Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

Copy link

how to set "HubConnection.ServerTimeout" in javascript client , like .net client


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@scottaddie scottaddie added the Source - Docs.ms Docs Customer feedback via GitHub Issue label Jun 5, 2018
@rachelappel
Copy link
Contributor

Hello @mmfarahat, Great question! Here's a sample you should be able to use now. We will be publishing a document on Configuration soon that will have this in it.

const connection = new signalR.HubConnection(
"/chathub",
{ serverTimeout: 100 });

@BrennanConroy
Copy link
Member

For the javascript client you can set the timeout after the connection has been created.

const connection = new signalR.HubConnectionBuilder()
    .withUrl("/chatHub")
    .build();

connection.serverTimeoutInMilliseconds = 1000; // 1 second

@mmfarahat
Copy link
Author

@rachelappel , @BrennanConroy Thanks

@imsam67
Copy link

imsam67 commented Jul 23, 2018

I believe the serverTimeoutInMilliseconds should have a larger value than the KeepAlive which is set on the server side. Or is it the other way around?

@BrennanConroy
Copy link
Member

That's correct, if serverTimeoutInMilliseconds is smaller than the keep alive on the server then it's very likely your client will think the server is gone and close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
None yet
Development

No branches or pull requests

6 participants