Hello
Then I provide to you my main file which include both task EthTcp and EthUdp which call main function in the "DV_Eth.c" file.
Each of them start and configure the need to open a socket on UDP and other in Tcp.
Bellow is the trace than optain with the code:
Device intialized on MAC Address 0.0.5E.0.0.0
Waiting for ethernet cable plug in ... Cable connected
Static IP bind ...
08:54:46.088 [RX] - Successful!
IP Address : 192.168.1.125
Subnet Address : 255.255.255.0
Gateway Address : 0.0.0.0
DNS Address : 0.0.0.0
08:54:47.098 [RX] - Init Rx UDP server...
08:54:48.103 [RX] - Init Tx UDP server...
08:54:48.593 [RX] - Wait Ethernet TCP connexion...
08:54:49.108 [RX] -
recvfrom() failed with error 1704
08:54:50.113 [RX] -
recvfrom() failed with error 1704
08:54:51.118 [RX] -
recvfrom() failed with error 1704
08:54:52.123 [RX] -
recvfrom() failed with error 1704
08:54:53.128 [RX] -
recvfrom() failed with error 1704
If I make a debbuger pause, I obtain following:

If UDP frame sent, no receive is OK. But data are weel keep because as soon as TCP connection will accepted, UDS sent data while TCP connecting will get!:
Waiting for ethernet cable plug in ... Cable connected
Static IP bind ...
09:15:35.767 [RX] - Successful!
IP Address : 192.168.1.125
Subnet Address : 255.255.255.0
Gateway Address : 0.0.0.0
DNS Address : 0.0.0.0
09:15:36.776 [RX] - Init Rx UDP se
09:15:36.799 [RX] - rver...
09:15:37.782 [RX] - Init Tx UDP server...
09:15:38.272 [RX] - Wait Ethernet TCP connexion...
09:15:38.787 [RX] -
recvfrom() failed with error 1704
09:15:39.792 [RX] -
recvfrom() failed with error 1704
09:15:40.797 [RX] -
recvfrom() failed with error 1704
09:15:41.802 [RX] -
recvfrom() failed with error 1704
09:15:42.807 [RX] -
recvfrom() failed with error 1704
09:15:43.812 [RX] -
recvfrom() failed with error 1704
09:15:44.817 [RX] -
recvfrom() failed with error 1704
09:15:45.822 [RX] -
recvfrom() failed with error 1704
09:15:46.827 [RX] -
recvfrom() failed with error 1704
09:15:47.832 [RX] -
recvfrom() failed with error 1704
09:15:48.837 [RX] - ->>>>>>>>>>>>> UDP data send from Computer with "PacketSender" software
recvfrom() failed with error 1704
09:15:49.842 [RX] -
recvfrom() failed with error 1704 ->>>>>>>>>>>>> UDP data send from Computer with "PacketSender" software
09:15:50.847 [RX] -
recvfrom() failed with error 1704
09:15:51.852 [RX] -
recvfrom() failed with error 1704
09:16:01.711 [RX] -
recvfrom() failed with error 1704
09:16:02.716 [RX] -
recvfrom() failed with error 1704
09:16:03.721 [RX] -
recvfrom() failed with error 1704
09:16:04.241 [RX] -
Connection TCP from 192.168.1.122, port 63133 at socket 0x1fff9a90 ------------------->>>>> DockLight connection on TCP port done....
09:16:04.726 [RX] -
Received 4 bytes of data.Data received: , Packet 1 -------------------->>>> previous Sent UDP data are received now!!!!!!!!!
--------SendTO Return = 10
09:16:05.731 [RX] -
Received 4 bytes of data.Data received: , Packet 2 -------------------->>>> previous Sent UDP data are received now!!!!!!!!!
--------SendTO Return = 10
09:16:06.746 [RX] - TimeOut expired. No data received. Trying again
09:16:07.761 [RX] - TimeOut expired. No data received. Trying again
09:16:08.771 [RX] - TimeOut expired. No data received. Trying again
09:16:09.785 [RX] - TimeOut expired. No data received. Trying again
09:16:17.778 [RX] - TimeOut expired. No data received. Trying again
09:16:18.793 [RX] - TimeOut expired. No data received. Trying again
09:16:19.802 [RX] - TimeOut expired. No data received. Trying again
09:16:20.809 [RX] -
Received 4 bytes of data.Data received: , Packet 3 -------------------->>>>New UDP data send from computer and then well received since TCP Ok !!
--------SendTO Return = 10
09:16:21.823 [RX] - TimeOut expired. No data received. Trying again
09:16:22.833 [RX] - TimeOut expired. No data received. Trying again
09:16:23.838 [RX] -
Received 4 bytes of data.Data received: , Packet 4
--------SendTO Return = 10 -------------------->>>>New UDP data send from computer and then well received since TCP Ok !!
09:16:24.853 [RX] - TimeOut expired. No data received. Trying again
09:16:25.863 [RX] - TimeOut expired. No data received. Trying again
09:16:42.047 [RX] - TimeOut expired. No data received. Trying again
09:16:43.057 [RX] - TimeOut expired. No data received. Trying again
09:16:44.072 [RX] - TimeOut expired. No data received. Trying again
Note: DV_EthUdp task has always the same error code but all works correctly....
Now, Both UDP and TCP message are well received/sent
------------------ To compare : ------------------
Test when TCP task is not started:
Device intialized on MAC Address 0.0.5E.0.0.0
Waiting for ethernet cable plug in ... Cable connected
Static IP bind ...
09:12:23.359 [RX] - Successful!
IP Address : 192.168.1.125
Subnet Address : 255.255.255.0
Gateway Address : 0.0.0.0
DNS Address : 0.0.0.0
09:12:24.368 [RX] - Init Rx UDP server...
09:12:25.373 [RX] - Init Tx UDP server...
09:12:26.388 [RX] - TimeOut expired. No data received. Trying again
09:12:27.403 [RX] - TimeOut expired. No data received. Trying again
09:12:28.418 [RX] - TimeOut expired. No data received. Trying again
09:12:29.424 [RX] -
Received 4 bytes of data.Data received: , Packet 1 ------> Here UDP frame was sent with "PacketSender software"
--------SendTO Return = 10 ------> Here board make a response and is well received by "PacketSender"
09:12:30.438 [RX] - TimeOut expired. No data received. Trying again
09:12:31.453 [RX] - TimeOut expired. No data received. Trying again
09:12:32.468 [RX] - TimeOut expired. No data received. Trying again
If I make debug pause, No error appears in UDP task...
Add:
After investiguation, error is set in function in sock_select.c
uint32_t sock_fds_poll(rtcs_fd_set * fds_ptr, uint32_t size, int32_t checkwhat, int32_t *error)
In this part :
RTCS_FD_ZERO(fds_ptr);
if(SOCK_ACT_TYPE_CLOSE == activity_type)
{
*error = RTCSERR_SOCK_ESHUTDOWN;
RTCS_FD_SET(closed_sock, fds_ptr);
}