Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

InetAddress.getByName fails  RSS feed

 
Robert Garrido
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an app in a cluster, this cluster has a master node which seizes an internal IP defined in all /etc/hosts file among the members of this cluster, when using the API:

new Socket(remoteHost, port, InetAddress.getByName(masterHostName), mastertPort);

"InetAddress.getByName(masterHostName)" fails and throws the exception:


java.net.SocketException: Invalid argument or cannot assign requested address
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:246)



Does anybody why it fails?

Thanks in advanced.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!