How can I read ICMP errors from connected UDP sockets?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is socket address with example?

657


What does af mean in sockets?

690


How does a socket work?

654


What is difference between socket and websocket?

654


How can I write a multi-homed server?

1415


What is a sae socket?

718


What is the difference between read() and recv()?

1730


Is socket a hardware or software?

686


Can a single socket port be used for multiple applications?

640


How many sockets can a port have?

654


What's the difference between impact sockets and regular sockets?

633


What are the types of sockets?

692


What is the difference between a socket and a port?

642


How to find other end of unix socket connection?

671


Is a socket a file?

620