How can I read ICMP errors from connected UDP sockets?



How can I read ICMP errors from connected UDP sockets?..

Answer / chaitanya

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.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix Socket Programming Interview Questions

Can multiple sockets use the same port?

0 Answers  


How can I read only one character at a time?

1 Answers  


How do I properly close a socket?

1 Answers  


Why does it take so long to detect that the peer died?

0 Answers  


How come select says there is data, but read returns zero?

1 Answers  


What is the purpose of socket?

0 Answers  


What are raw sockets?

4 Answers   Axis Technologies,


over the socket? Is there a way to have a dynamic buffer? What does one do when one does not know how much information is coming?

1 Answers  


How does a socket work?

0 Answers  


How can I bind() to a port number < 1024?

1 Answers  


How should I choose a port number for my server?

1 Answers  


What is a socket set used for?

0 Answers  


Categories