Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ICMP Port Unreachable

808859Nov 3 2010 — edited Nov 4 2010
Can someone clarify what the exception java.net.PortUnreachableException: ICMP Port Unreachable indicates (aside from the obvious)? Here is the scenario: using UDP I have a client application, a gateway application, and a server application. The client sends to the server through the gateway and vice versa. I have created 2 sockets, one between the client and the gateway and one between the gateway and the server. When I try to send from the gateway to the client the packet never makes it to the client (server side is fine). When I call sock.getLocalSocketAddress and sock.getRemoteSocketAddress both are 0.0.0.0 (the latter at least has the right port number). The gateway acts as a server for the client and as a client to the server. I tried to fix this using sock.connect on the gateway side for the client facing socket but this eventually generates the ICMP port unreachable exception on the gateway side when receiving from the client.

Thank you in advance.
This post has been answered by EJP on Nov 4 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2010
Added on Nov 3 2010
2 comments
3,630 views