Hi,
Just started learning java. I'm writing an Android app, and want to connect to a TCP server using a domain name, eg. myserver.mydomain.com
The code I'm using is:
This line causes the app to hang. If I remove the getHostAddress() bit, eg.
Then it will timeout eventually, but never try the connection.
The TCP server app listening at the other end is a Delphi app I wrote with logging, and I can see that it's never receiving the connection request.
Help please?
Just started learning java. I'm writing an Android app, and want to connect to a TCP server using a domain name, eg. myserver.mydomain.com
The code I'm using is:
Code:
Socket connfd = new Socket (InetAddress.getByName("myserver.mydomain.com").getHostAddress(), 3280);
This line causes the app to hang. If I remove the getHostAddress() bit, eg.
Code:
Socket connfd = new Socket (InetAddress.getByName("myserver.mydomain.com"), 3280);
The TCP server app listening at the other end is a Delphi app I wrote with logging, and I can see that it's never receiving the connection request.
Help please?