vb.net - cannot receive UDP Packet from microcontroller -



vb.net - cannot receive UDP Packet from microcontroller -

i'm working on udp communication pc <-> arm lm3s6965 (luminary) through ethernet. on pc there vb.net application simulates udp server/client.

when packet sent pc arm lm3s6965, packet received without errors, when arm lm3s6965 sends udp packet pc, packet lost somewhere (the application doesn’t receive it).

the unusual thing wireshark captures these packets coming pc , seems valid.

turning off firewall in windows did not help. know topic might wrong forum, can explain why wireshark captures these packets, application doesn’t? arm lm3s6965 (192.168.0.100), pc (192.168.0.116), sending , receiving goes through port number 3040, , sending broadcast message vb.net application received arm lm3s6965 micro controller.

here vb.net code:

public const mnport int16 = 3040 'port number send/recieve info on public const msbroadcastaddress string = "255.255.255.255" 'sends info local listening clients, send info on wan you'll need come in public (external) ip address of other client public udpreceivingclient udpclient 'client handling incoming info public udpsendingclient udpclient 'client sending info public receivingthread thread 'create separate thread hear incoming data, helps prevent form freezing public mbiclosing boolean = false 'used close clients if form closing public sub initializesender() udpsendingclient = new udpclient(msbroadcastaddress, mnport) udpsendingclient.enablebroadcast = true end sub public sub initializereceiver() udpreceivingclient = new udpclient(mnport) 'dim start threadstart = new threadstart(addressof mt_receiver) 'receivingthread = new thread(start) 'receivingthread.isbackground = true 'receivingthread.start() end sub public sub mt_send_udp(byval lbtxbuffer() byte) seek udpsendingclient.send(lbtxbuffer, lbtxbuffer.length) grab ex exception msgbox(ex.tostring) end seek seek udpreceivingclient.beginreceive(addressof mt_rx_callback, nothing) grab ex exception msgbox(ex.tostring) end seek end sub public sub mt_rx_callback(byval ir iasyncresult) dim endpoint ipendpoint = new ipendpoint(ipaddress.any, 3040) dim lbdata() byte dim llret uint16 if mbiclosing = false llret = udpreceivingclient.available lbdata = udpreceivingclient.endreceive(ir, endpoint) if llret > 0 mt_validate_msg(lbdata) end if udpreceivingclient.beginreceive(addressof mt_rx_callback, nothing) end if end sub private sub frmsearchudp_formclosing(byval sender object, byval e system.windows.forms.formclosingeventargs) handles me.formclosing mbiclosing = true udpreceivingclient.close() udpsendingclient.close() frmmain.timer.enabled = true end sub private sub frmsearchudp_load(byval sender object, byval e system.eventargs) handles me.load initializesender() initializereceiver() end sub

more comment, it's long ...

no196: 42.430628 192.168.0.168 -> 255.255.255.255 (from pc hardware) udp ... source port: 63162 (63162) destination port: tomato-springs (3040)

this looks nice , works obviously, hardware send response.

no197: 42.431017 192.168.0.100 -> 255.255.255.255 (from hardware pc) source port: tomato-springs (3040) destination port: 63162 (63162)

why pc should receive packet? destination port 63162 hear port 3040.

vb.net embedded microcontroller udpclient

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -