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 |
How to find other end of unix socket connection?
What is socket address with example?
How many sockets can a port have?
Why does the sockets buffer fill up sooner than expected?
How come only the first part of my datagram is getting through?
How does unix socket work?
How come I get address already in use from bind()?
Why do we need socket programming?
Is a socket a file?
How do I send [this] over a socket?
Why do we need sockets?
Is there any advantage to handling the signal, rather than just ignoring it and checking for the EPIPE error? Are there any useful parameters passed to the signal catching function?