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

IOException When Websocket Frame opcode == 0 #1000

Open
yayuntian opened this issue May 12, 2023 · 1 comment
Open

IOException When Websocket Frame opcode == 0 #1000

yayuntian opened this issue May 12, 2023 · 1 comment

Comments

@yayuntian
Copy link

Bug exists Release Version 1.2.5 ( Master Branch)

public WebSocketFrame(InputStream input) throws IOException {
.....
throw new IOException("Invalid Frame: Opcode: " + this.opcode);

https://www.rfc-editor.org/rfc/rfc6455#section-5.2 SDK should support opcode 0

@nuessgens
Copy link

nuessgens commented Aug 3, 2024

It seems that the same happens for opcode 0x9 (PING).
Or - to be preceise - the exception is thrown for anything other than opcode 0x2 (BINARY) and opcode 0x8 (CLOSE).

Unfortunately mosquitto seems to send PING WS-Frames form time-to time (exactly after 5 minutes; no matter how much activity was on the ws-connection before)
This than triggerd all the side-effects of the last-will etc.

Took me several hours to find out that this is a bug in paho mqtt websocket implementation.
Sadly figuring this out took longer than writing an own NetworkModuleFactory for websockets based on the jdk11 java.net websocket-client.

If websocket is ment to be supported the paho java mqtt client has at least cover the basic websocket-spec (like the opcodes and also respond to the PING frame with a PONG 0xA echoing the content)

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

2 participants