olofd / react-native-signalr

Use SignalR with React Native
150 stars 61 forks source link

sometimes got an error 'No transport could be initialized successfully...' #13

Closed jibenziliao closed 7 years ago

jibenziliao commented 7 years ago

It connected failed sometimes,but it worked sometimes. And I got this error: "Error: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."

This is my code: connection.start({transport: 'webSockets'}).done(() => { console.log('success'); }).fail(() => { console.log('error') }); connection.error(function(error){ console.log(error)//this prints that error. });

vahidhiv commented 7 years ago

I use the sample code and watching console. It can't connect through websocket and trying to downgrade and finally it is connecting through long polling. What 's wrong? Is it related to server's signalr version or something?

olofd commented 7 years ago

@vahidhiv Very hard to tell what's wrong from these vauge descriptions.

vahidhiv commented 7 years ago

@olofd I can send whatever is needed! Log of console is enough?

olofd commented 7 years ago

Start with that. post them here.

olofd commented 7 years ago

@vahidhiv @jibenziliao I've just released 0.0.11. It contains a fix for suppressed error messages. It also contains a new README.md with new test code that runs agains a test-server I've setup in Azure. @jibenziliao Please see if you can reproduce your error against the test-server and also post the logs you already have!

jibenziliao commented 7 years ago

@olofd It always works fine with test test-server.

success

I think there is something wrong with my server or the network.

bug

If I use the original webSocket,it got the response code of 503 sometimes with my server.

bug2

My partner will fix the bug with the server. Thank you very much!

olofd commented 7 years ago

Ah. Glad that the test server came to use. Good luck finding your bug!