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 |
What is the difference between connected and unconnected sockets?
How do I properly close a socket?
How do I get the port number for a given service?
What is af_inet in socket?
When should I use shutdown()?
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?
How can I read ICMP errors from connected UDP sockets?
What's better 6pt or 12pt sockets?
Why do we need sockets?
What is the difference between close() and shutdown()?
What is a sae socket?
How can I bind() to a port number < 1024?