Closed phuocbitmark closed 1 year ago
@phuocbitmark What is your print output of the url when you connect to the second room? Is this the same as the first?
I'm not aware of any caching that would exhibit this behavior in package:web_socket_channel
. We flow the arguments fairly directly to WebSocket.connect
. https://api.dart.dev/stable/3.1.3/dart-io/WebSocket/connect.html
@brianquinlan - is there any caching/reuse by Uri in the VM implementation?
@phuocbitmark - can you provide a minimal code sample that generates this behavior?
I tried making two clients connected to Uris which differ only by a query parameter, and I cannot reproduce any unexpected behavior.
@phuocbitmark - could the reuse be happening in your implementation?
Thank you for your time. I had resolved the problem, and it's my fault, i didn't realize that the signature in my header was cached. Sorry you guys.
Hi, I'm working on an app that have chat feature. When i enter to a chat room i connect to channel url = baseUrl?param1=...¶m2=... _websocketChannel = IOWebSocketChannel.connect(url, header... When i leave chat i close it _websocketChannel.sink.close();
It works if i only use one chat room. But if i leave the first room and enter another room, which mean same baseUrl but different param, i couldn't connect. It appears to me that when i enter the second chat room, it used the first room's param to connect. The url somehow was cached. I have to kill app and open it again to use different param. We check our backend side code, and it doesn't seem to be backend problem.
Do you know what the root cause and how to fix it? Thank you
PS: i'm using version ^2.1.0, even i upgrade, i still experience the same problem