UDP connected socket, any obvious omission?
# help
d
I am attempting to connect to the rsmb MQTT-SN broker. In my client, I have setup code:
Copy code
constructor --.gateway --.port=1885:

  open -> none:
    network = net.open
    udp_socket = network.udp_open
    server_address = net.SocketAddress (net.IpAddress.parse gateway) port
    udp_socket.connect server_address
and where I send the payload
Copy code
send_ payload/ByteArray -> none:
    msg := udp.Datagram payload server_address
    udp_socket.send msg
    packet_id++
On the server log, I see
CWNAN0075W Socket error 107 (Transport endpoint is not connected) in getpeername for socket 4
This is reported, running the client on either host or device. Is there any obvious error you see in the snippets above?
f
@erikcorry any ideas?
d
Thx. Found a simple C test case (for QOS -1) in Eclipse Paho, rsmb broker responds correctly to that. The
udp_socket.connect
is unnecessary. Same behavior when removed. Will use Wireshark, expect then I formatted the packet incorrectly.
Fixed. Badly formatted flag field in the MQTT-SN packet, but strange rsmbroker reported
Socket error 107