Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Receive through UDP

Altera_Forum
Honored Contributor II
1,081 Views

Hi All, 

 

this is a fragment of my code.... I'm trying to receive through UDP, but the port is not reachable according to etherreal when I am trying to send something from a pc.... Help anyone?! 

 

******************************************************************** 

 

packetBuffer = pbuf_alloc(PBUF_TRANSPORT,sizeof(packetBuffer),PBUF_RAM); 

 

IP4_ADDR(&udpDestIpAddr, 169, 254, 0, 1); 

 

udpSocket = udp_new(); 

udp_bind(udpSocket, IP_ADDR_ANY, 666); 

udp_connect(udpSocket, &udpDestIpAddr, 666); 

 

 

 

printf("Ready to receive....\n"); 

while(1) 

//0.6.4 lan91c111if_service(netif); 

 

udp_recv(udpSocket, &packetBuffer, (int *)sizeof(packetBuffer)); 

 

if(buffer != NULL) 

 

 

printf("Pakket is ontvangen"); 

 

 

******************************************************************** 

 

Revolt really helped me out on this, but I need to know how I can receive. 

 

Cheers, 

 

Danny
0 Kudos
0 Replies
Reply