Unix Socket Programming Question:

Download Job Interview Questions and Answers PDF

How can I read ICMP errors from connected UDP sockets?

Unix Socket Programming Interview Question
Unix Socket Programming Interview Question

Answer:

If the target machine discards the message because there is no process reading on the requested port number, it sends an ICMP message to your machine which will cause the next system call on the socket to return ECONNREFUSED. Since delivery of ICMP messages is not guarenteed you may not recieve this notification on the first transaction.

Download Unix Socket Programming Interview Questions And Answers PDF

Previous QuestionNext Question
What is the difference between connected and unconnected sockets?How can I be sure that UDP messages are received in order?