guild icon
Toit
#UDP connected socket, any obvious omission?
Thread channel in help
davidg238
davidg238 10/07/2022 06:32 PM
I am attempting to connect to the rsmb MQTT-SN broker. In my client, I have setup 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
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?
floitsch
floitsch 10/07/2022 11:15 PM
@erikcorry_arbat any ideas?
davidg238
davidg238 10/08/2022 01:26 AM
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.(edited)
davidg238
davidg238 10/08/2022 08:27 PM
Fixed. Badly formatted flag field in the MQTT-SN packet, but strange rsmbroker reported Socket error 107
👍1
4 messages in total