Setup: h/w Arduino Uno with ethernet shield s/w UDPSendReceiveString example as is, apart from IP address change, and local port set to 8022 instead of 8888. (this example receives a UDP packet then auto replies on the same port)
What happens: UDP data received ok on port 8022 but auto reply not appearing at sender. The line Serial.println(Udp.remotePort()); is displaying a high port number that oddly, increases by 1 each time another packet is received.
If I force the reply packet to use port 8022 (using Udp.beginPacket(Udp.remoteIP(), localport);) rather than this high number that the variable Udp.remotePort seems to contain, the reply is received back at the sender ok.
I should say that I know the calling UDP packet is on port 8022 as 1/ only that port triggers the response, and 2/ other software gets the 8022 call from the same source ok. In any case the sending port number is not increasing per packet.
There is probably an easy answer. I did read somewhere about another ethernet library for certain boards ?....but I can't find the reference now.