0

I have a server socket in my android app and the following lines (listening/waiting for a connection):

rclient = serverSocket.accept();
String stt=rclient.getInetAddress().getHostAddress();

I get this : ::1

Can anyone kindly tell me whats my mistake here ?

I have also tried getRemoteSocketAddress, However, that also gives some crap output./::1/::0142342 ...

thanks.

2
  • It would help an awful lot if you told us the actual output you got. Commented Dec 17, 2011 at 2:27
  • That 'crap' is an IPv6 address. Commented Dec 17, 2011 at 7:21

1 Answer 1

2

You are getting correct outputs. It's not clear why you think they're "crap output". They are in fact the correct IP addresses. ::1 is a valid IP address, it is the IPv6 address assigned to the loopback adapter.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.