Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Sockets: accessing extended error information

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?