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

Why does the sockets buffer fill up sooner than expected?

993


Are unix sockets faster than tcp?

494


system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?

1163


What is the difference between SO_REUSEADDR and SO_REUSEPORT?

1354


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

471






How are unix domain sockets implemented?

492


Whats the difference between select() and poll()?

1208


What does af mean in sockets?

519


How many sockets can a port have?

477


What is the purpose of socket?

501


Where is the socket located?

469


How many socket connections can a server handle?

468


Why do we need socket programming?

493


How can I force a socket to send the data in its buffer?

1095


How can I set the timeout for the connect() system call?

1107