Socket Programming(UDP)
-
Hi all. I develop an application that send UDP packet to the embedded board. Embedded Board cannot receive packet because packet protocol changed to ARP. If I replace the Embedded Board with a PC and sniff network with WireShark, UDP packets are seen. what's the problem? If I send UDP packet with PacketBuilder to the Embedded board, it can receive it. I use MFC CSocket class to send UDP packet. My Code is:
CSocket sockSrvr; if ( sockSrvr.Create(1239,SOCK\_DGRAM)==0) { MessageBox("Can't create socket"); return FALSE; } char data\[100\]; memset(data,1,sizeof(data)); if ( sockSrvr.SendTo(data,sizeof(data),1239,"10.14.83.11")<=0) { MessageBox("Error in Sending"); return FALSE; } sockSrvr.Close(); return TRUE;
I test windows API to send UDP packet but not differ with CSocket. thanks for your help
-
Hi all. I develop an application that send UDP packet to the embedded board. Embedded Board cannot receive packet because packet protocol changed to ARP. If I replace the Embedded Board with a PC and sniff network with WireShark, UDP packets are seen. what's the problem? If I send UDP packet with PacketBuilder to the Embedded board, it can receive it. I use MFC CSocket class to send UDP packet. My Code is:
CSocket sockSrvr; if ( sockSrvr.Create(1239,SOCK\_DGRAM)==0) { MessageBox("Can't create socket"); return FALSE; } char data\[100\]; memset(data,1,sizeof(data)); if ( sockSrvr.SendTo(data,sizeof(data),1239,"10.14.83.11")<=0) { MessageBox("Error in Sending"); return FALSE; } sockSrvr.Close(); return TRUE;
I test windows API to send UDP packet but not differ with CSocket. thanks for your help
-
If the board will not accept UDP packets then there is not much you can do. You need to read the device's documentation to find out how it works.
-
Thank for your reply. Board can accept UDP packet. It can receive packet that generated with colasoft packet builder. Thanks again.