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

Issue 16: Added protocol as a connection parameter #19

Merged
merged 2 commits into from Oct 31, 2020

Conversation

JCash
Copy link
Contributor

@JCash JCash commented Oct 31, 2020

No description provided.

@JCash JCash requested a review from britzl October 31, 2020 09:19
@JCash JCash linked an issue Oct 31, 2020 that may be closed by this pull request
Copy link
Contributor

@britzl britzl left a comment

Choose a reason for hiding this comment

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

Looks good! Although I have a question about the effect on existing connections when changing protocol

@@ -709,6 +712,13 @@ static dmExtension::Result OnUpdate(dmExtension::Params* params)
#if defined(__EMSCRIPTEN__)
conn->m_SSLSocket = dmSSLSocket::INVALID_SOCKET_HANDLE;

if (conn->m_Protocol) {
EM_ASM({
Copy link
Contributor

Choose a reason for hiding this comment

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

So this changes the sub-protocol for all active web sockets? Could that become a problem? Or is the sub-protocol only set when connecting?

Copy link
Contributor Author

@JCash JCash Oct 31, 2020

Choose a reason for hiding this comment

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

It might be an issue.
I couldn't really find how the defold-websocket solved this issue?
I now saw that it didn't.

According to the emscripten code itself, it seems to be a per-connection setting.
https://github.com/emscripten-core/emscripten/blob/fc67fbf94b6b815c619e75dfe59c84f3c81bf698/src/library_sockfs.js#L193-L230

(Which I think makes sense, since it's a header in the handshake request.

Another option would be to set it at the app initialization phase. But we could do that if we find it to be an actual issue.

@JCash JCash merged commit ed6d131 into master Oct 31, 2020
@JCash JCash deleted the issue-16-conneciton-protocol branch October 31, 2020 14:48
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.

Add protocol connection parameters
2 participants