Skip to content

Disconnect on Publish when using WebSocket #1690

@stefxx

Description

@stefxx

Describe the bug

After successfully connecting to AWS using WebSockets, and being able to receive messages, the connection is immediatly disconnected on a PublishAsync except when sending a empty payload.

Which component is your bug related to?

  • Client

To Reproduce

Connect to AWS using WebSockets
Publish anything (except empty payload)
This is the code I use to Publish:

    Function MqttPublish(Topic As String, ByVal Payload As String) As Task(Of MqttClientPublishResult)
        Return mqttClient.PublishAsync(New MqttApplicationMessage With {
        .Topic = Topic,
        .Payload = Encoding.Unicode.GetBytes(Payload)
    })
    End Function

Note that the MqttClientDisconnectedEventArgs.Exception is nothing. Also, the PublishAsync.Result is "Success" and does not trigger an exception.

Expected behavior

That the Payload is being send without disconnecting from the broker

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions