Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lost message after Reconnect() #148

Open
qingyu-sama opened this issue Apr 16, 2024 · 0 comments
Open

lost message after Reconnect() #148

qingyu-sama opened this issue Apr 16, 2024 · 0 comments

Comments

@qingyu-sama
Copy link

qingyu-sama commented Apr 16, 2024

it's work

var ws = new(new Uri(config.CommanderAddress.WebSocketAddress));

ws.MessageReceived
		  .ObserveOn(TaskPoolScheduler.Default)
		  .Subscribe(OnMessage, OnError);
ws.DisconnectionHappened
		  .ObserveOn(TaskPoolScheduler.Default)
		  .Subscribe(OnClose, OnError);
ws.ReconnectionHappened
		  .ObserveOn(TaskPoolScheduler.Default)
		  .Subscribe(OnReconnection, OnError);

ws.Start();

when I call ws.Reconnect();
I can't received first message

Console.WriteLine("Refresh");
ws.Url = new Uri(config.CommanderAddress.WebSocketAddress);
ws.Reconnect();

Console:
(Frist message)
(Ping message)
...
Refresh
(Ping message)
...

when I call ws.Reconnect(); again
it's work

Console:
(Frist message)
(Ping message)
...
Refresh
(Ping message)
...
Refresh
(Frist message)
(Ping message)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant