Altera_Forum
Honored Contributor
20 years agoReceive through UDP
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