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

Fix WS protocol for trycp client #214

Merged
merged 4 commits into from
Jun 14, 2024

Conversation

ThetaSinner
Copy link
Member

@ThetaSinner ThetaSinner commented Jun 13, 2024

Without Ping/Pong handling, the connection was being force closed by the TryCP server.

The close message has empty content which was giving me a very confusing EOF trying to deserialize from the empty vector into a response message.

Explicitly handling the WS protocol now and it's working much better

@ThetaSinner ThetaSinner requested a review from jost-s June 13, 2024 18:32
let pend2 = pend.clone();
let recv_task = tokio::task::spawn(async move {
while let Some(Ok(msg)) = stream.next().await {
let msg = msg.into_data();
let msg = match msg {
Message::Close(_) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth outputting the variant field value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea, I'll be back here next week adding it if I don't do it now :D

Copy link
Contributor

@neonphog neonphog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎸

@ThetaSinner ThetaSinner merged commit e818821 into develop Jun 14, 2024
2 checks passed
@ThetaSinner ThetaSinner deleted the fix-ws-protocol-for-trycp-client branch June 14, 2024 10:12
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

Successfully merging this pull request may close these issues.

3 participants