1

So I continue to work on my Android network scanner, and now on my Android tablet I get this problem.

Using the following code, I get a successful connection.

Socket mySocket = new Socket(iIPv4 + i, port);

Using this code, it fails to ever connect.

Socket mySocket = new Socket();
SocketAddress address = new InetSocketAddress(iIPv4 + i, port);
mySocket.connect(address, 1000);

The problem is, I need to lower the timeout as seen via the .connect() function. 1000 is way too high, I just tried raising it for debugging purposes.

Anyone got any ideas?

1
  • Interestingly enough, if I set the .connect() function to a timeout of zero, it connects! Higher numbers such as 5000 or 10000 do not connect. Commented Mar 7, 2011 at 15:13

1 Answer 1

1

I found the problem. I needed to go into a memory manager and terminate the process manually in order to clear things up.

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.