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

While publishing with websocket - server close #1499

Closed
TomaszKustra opened this issue Aug 18, 2022 · 2 comments · Fixed by #1514
Closed

While publishing with websocket - server close #1499

TomaszKustra opened this issue Aug 18, 2022 · 2 comments · Fixed by #1514
Labels
bug Something isn't working

Comments

@TomaszKustra
Copy link

When i want to publish payload with topic - MqttChannelAdapter using MqttWebSocketChannel w'll send first topic (packet) and then payload - each time MqttWebSocketChannel send data with "endOfMessage" param "true".
For me server (i don't knwo implementation i'm calling only uwing API description) - closing seocket.
When i changed MqttChannelAdapter method to:


                    if (_channel is MqttWebSocketChannel)
                    {
                        var buff=packetBuffer.ToArray();                        
                        await _channel.WriteAsync(buff, 0, buff.Length, cancellationToken).ConfigureAwait(false);
                    }
                    else
                    {
                        await _channel.WriteAsync(packetBuffer.Packet.Array, packetBuffer.Packet.Offset,
                            packetBuffer.Packet.Count, cancellationToken).ConfigureAwait(false);

                        if (packetBuffer.Payload.Count > 0)
                        {
                            await _channel.WriteAsync(packetBuffer.Payload.Array, packetBuffer.Payload.Offset,
                                packetBuffer.Payload.Count, cancellationToken).ConfigureAwait(false);
                        }
                    }

working form me.

Maybe adding the "SendAtOnce" property to the MqttChannelAdapter and sending the packet in whole or in parts depending on it would solve the problem permanently.

@TomaszKustra TomaszKustra added the bug Something isn't working label Aug 18, 2022
@chkr1011
Copy link
Collaborator

Please check version 4.1.0.269 from the myget feed. It contains a fix. Please let me know if it works.

@chkr1011
Copy link
Collaborator

I was wrong. Please test version 4.1.272 from myget feed (see README) and let me know if it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants