I am getting the following error: jquery.signalR.js:869 Uncaught Error: SignalR: Connection must be started before data can be sent. Call .start() before .send().
It only happens about 1 in 20 application starts.
I am using React and SignalR ASP.NET.
The web audio streamer calls the callback with the invocation of 'StartSound' in it's constructor.
I am certain that the problem is related to webAudioStreamer calling the start sound method, and my reasons are:
Whenever I see that error I have no sound, and surprise surprise if 'startSound' is not called you have no sound.
The audio thread, on the server side code, which is started by 'startSound' doesn't run when I see that error, but does otherwise.
Pictures always work even if there is no sound. This means that the 'Init' must be working otherwise there would be no pictures.
useEffect(
() => {
if (gameState == 'connecting') {
var connection = ($ as any).hubConnection(`${window.location.protocol}//${window.location.host}/`);
var hubServer = connection.createHubProxy('HubServer');
connection.start().done(
function () {
hubServer.invoke('Init'. . .).done(function () {
setProxy(hubServer);
setWebAudioStreamer(
new WebAudioStreamer(
() => {
hubServer?.invoke('StartSound');
},
() => {
hubServer?.invoke('StopSound');
}))
setGameState('running');
})
})
}
}
, [gameState]);
None
0 Points
3 Posts
Getting 'Connection must be started before data can be sent. Call .start() before .send()' even t...
May 04, 2020 12:44 PM|Manannan|LINK
Hello,
I am getting the following error: jquery.signalR.js:869 Uncaught Error: SignalR: Connection must be started before data can be sent. Call .start() before .send().
It only happens about 1 in 20 application starts.
I am using React and SignalR ASP.NET.
The web audio streamer calls the callback with the invocation of 'StartSound' in it's constructor.
I am certain that the problem is related to webAudioStreamer calling the start sound method, and my reasons are: