Closed brianpricesmith closed 10 months ago
You can access the HubConnection object and change that property through dotnetify.hub._connection
.
Awesome thank you. With typescript I was able to do what I needed by extending the IDotnetifyHub interface, then accessing the property you described. Example code below:
import { IDotnetifyHub } from 'dotnetify';
import { HubConnection } from '@microsoft/signalr';
export interface IDotnetifyHubConnection extends IDotnetifyHub {
_connection: HubConnection
}
const dotnetifyHub = dotnetify.hub as IDotnetifyHubConnection;
if(dotnetifyHub?._connection && dotnetifyHub._connection.serverTimeoutInMilliseconds !== 60000){
dotnetifyHub._connection.keepAliveIntervalInMilliseconds = 30000;
dotnetifyHub._connection.serverTimeoutInMilliseconds = 60000;
}
I have a VM that in some cases can take longer than the default 30 seconds to load. It looks like the setting for this is on the @microsoft/signalr hub connection class. It’s called serverTimeoutInMilliseconds. Is there a way to access this through dotnetify? I tried using the hubOptions connection builder and was not successful. Thanks!