12-14-2011 02:25 PM
Suppose I have client - server application that utilizes UDP communication. A client sends UDP packet to the server and wants to be 'somewhat' sure that this packet reached the Server. Now let's get to coding. In Linux I can easily use something like:
res = recvmsg(s, buf, MSG_ERRQUEUE);
And if the Server currently is not running or there is some firewall preventing client's packets from reaching the server the client would receive ICMP packet and this function would still return 0 with lots of information in so called "anciallary message", then I can analyze ICMP response by using cmsg().
Basically I want to differentiate between different types of ICMP responses.
Here in QNX I can't find MSG_ERRQUEUE flag defined anywhere and recvmsg() returns -1 in scenario described above with errno=ECONNREFUSED (if I am not mistaken, do not have PB near my desk now).
Is there any way to access information received in ICMP packet?