I'm using the socket service in my application
mSocket = new SocketIO("ip:port"); //work smoothly
However we need to use the "hostname" instead of ip. When I refer to "hostname", it means the "hostname" command in windows. The image below is the command I'm using.
When I use the hostname instead of ip
this way
mSocket = new SocketIO("hostname:port"); //not work
android launches an android error -
io.socket.SocketIOException: Error while handshaking with hostname. Unable to resolve host "null": No address associated with hostname
The DNS server your device is configured to use does not have an entry for the name. Thus the name can't be resolved to an address. You need to configure your DNS correctly to be able to use names.