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 programming in java?

483


What is a socket connection?

494


How can I write a multi-homed server?

1270


Can multiple sockets use the same port?

488


What is the difference between SO_REUSEADDR and SO_REUSEPORT?

1349






Is tcp or unix socket faster?

492


What is the purpose of socket?

497


What is difference between socket and websocket?

473


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

1157


What are the types of sockets?

487


How does unix socket work?

497


What is active unix domain sockets?

540


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

1088


Can multiple clients connect to same socket?

509


What is a socket address?

516