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 |
When will my application receive SIGPIPE?
What is the purpose of socket?
How come only the first part of my datagram is getting through?
What are socket exceptions? What is out-of-band data?
How do I get my server to find out the clients address / host- name?
When should I use UDP instead of TCP?
Can a single socket port be used for multiple applications?
What is a socket connection?
What pieces of information make up a socket?
How can I write a multi-homed server?
Why do not my sockets close?
How to find other end of unix socket connection?