You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to make connection with HUB and default transport setting is throwing error with 1002 code. Why do I need to set up transport: HttpTransportType.serverSentEvents ? It shouldn't be managed automatically by library by chosing the best option? Or maybe there is possibility to achieve it?
connection =HubConnectionBuilder()
.withUrl(
'https://url/hub/chat',
HttpConnectionOptions(
// transport: HttpTransportType.serverSentEvents, (Only when I uncomment this line then I can make connection)
logging: (level, message) =>print('test: $message'),
),
)
.build();
await connection.start();
Error without transport: HttpTransportType.serverSentEvents:
StartingHubConnection.
Starting connection with transfer format 'TransferFormat.text'.
Sending negotiation request: https://url/hub/chat/negotiate.Selecting transport 'HttpTransportType.webSockets'.
(WebSockets transport) Connecting.
WebSocket connected to wss://url/hub/chat?id=ARXbK9CjBkJjxWPSAHTzHg.TheHttpConnection connected successfully.
Sending handshake request.
(WebSockets transport) sending data. String data of length '32'.
UsingHubProtocol'json'.
(WebSockets transport) socket closed.
HttpConnection.stopConnection(Exception:WebSocket closed with status code:1002 (null).) called whilein state ConnectionState.connected.
Connection disconnected with error 'Exception: WebSocket closed with status code: 1002 (null).'.
HubConnection.connectionClosed(Exception:WebSocket closed with status code:1002 (null).) called whilein state HubConnectionState.connecting.
HttpConnection.stopConnection(null) called whilein state ConnectionState.disconnected.
Call to HttpConnection.stopConnection(null) was ignored because the connection is already in the disconnected state.
Hub handshake failed with error 'Exception: WebSocket closed with status code: 1002 (null).' during start(). StoppingHubConnection.
Call to HttpConnection.stop(Exception:WebSocket closed with status code:1002 (null).) ignored because the connection is already in the disconnected state.
HubConnection failed to start successfully because of error '{Exception: WebSocket closed with status code: 1002 (null)..toString()}'
The text was updated successfully, but these errors were encountered:
The reason is a bug in the package. I reported it more than a year ago, see https://github.com/jamiewest/signalr_core/issues/38. If you want to make it work then fix it yourself and submit a pull request here. Thanks.
Hi, I'm trying to make connection with HUB and default transport setting is throwing error with 1002 code. Why do I need to set up
transport: HttpTransportType.serverSentEvents
? It shouldn't be managed automatically by library by chosing the best option? Or maybe there is possibility to achieve it?Error without
transport: HttpTransportType.serverSentEvents
:The text was updated successfully, but these errors were encountered: