Hi Jaroslave:
I think you only need one socket to communicate.
I made a simple udp server demo , I modified this demo based on Freescale_MQX_4_2\rtcs\examples\eth_to_serial, you can replace with the attached files.
The udp server source port is 5000, it can receive all packets.
If you need to receive packets only with port 5001, you can change this line in demo.c
server_socket_addr.sin_addr.s_addr = INADDR_ANY; -> server_socket_addr.sin_addr.s_addr = 5001;
Regards
Daniel