Hi,
RTCS_geterror(sock); is returning
#define RTCSERR_UDP_PORT_ZERO (RTCS_ERROR_BASE|0x665) /* can't send to port 0 */
after I do something like this (just to illustrate easily the problem):
sendto();
_time_delay(10);
recvfrom(... RTCS_MSG_PEEK ...); //no data to receive as the turn around time is 100mS
//Quickly try to resend
sendto(); //This will ALWAYS return the above error
so I tried this
sendto();
_time_delay(1);
recvfrom(... RTCS_MSG_PEEK ...); //no data to receive as the turn around time is 100mS
shutdown(sock...);
sock = socket(PF_INET, SOCK_DGRAM, 0);
error = bind(sock, &local_sin, sizeof(local_sin));
sendto(); //This will ALWAYS return the above error
The point is, I need to be able to have a UDP timeout and retry, so i need to use recvfrom() as a non blocking to make my timeout, but cannot work out what to do to shutdown() and socket_bind() to get it to come back so that I can send again...
Normally,if message peek returns no error and none zero, I do a normal recvfrom(); to get the datagram. all this works fine, ist only a problem when the timeout happens
Solved! Go to Solution.
CW = Current 7.1.2 with all updates, MQX = Current 3.4, target 52259evb using MRAM debug for testing.
in user_config.h, I only have UDP, ICMP and GATEWAY's enabled, all the other RTCS stuff is off.
We have now tested this with MQX3.5 with no usable result.
We are desperately in need of a working UDP timeout example or idea on how to get it going as RTCS and its documentation is clearly lacking in this fundamental area.
we just need to send a packet, if it doesn't get the response, close the connection, reopen and resend. Using RTCS_MSG_PEEK causes the next sendto(); to return an error. there must be more to shutting down that just
shutdown();
socket();
bind();
after timeout using RTCS_MSG_PEEK error.
I hope I am just making a simple mistake, but I am unable to progress based on the examples / documentation.