David
David

Reputation: 1296

Android socket won't connect via .connect() function, only new Socket()

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?

Upvotes: 1

Views: 1398

Answers (1)

David
David

Reputation: 1296

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

Upvotes: 1

Related Questions