Issues with TCP Client/Server

Jo_Han_Solo

New member
Oct 5, 2017
3
0
0
Hey guys,

I wrote this basic TCP Client in Android with a C++ Server running in Linux.

Now the thing is this worked through Ethernet with a Rooted Samsung Note 2, however, with a brand spanking new Samsung Galaxy Note 8, it no longer works. Everything works great on the Rooted Note 2. But when I try to open up the connection to the server on the Note 8 the app crashes.

Granted the Note 8 phone is not rooted, however, I didn't think it would be necessary since it supports Ethernet natively.

Basically my question is, does any of you guys have any experience with sockets and TCP communications on the Note 8 through an Ethernet connection, or have any idea of what might be causing the app to crash when I try to connect on the Note 8?

The server still establishes the connection in C++, but each time it does the app crashes on Android.

Cheers!
 
Actually this problem was solved by adding the following lines to the MainActivity:

StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);

So if anyone else encounters a similar issue. This might help you.
 

Forum statistics

Threads
952,145
Messages
6,955,481
Members
3,162,574
Latest member
AnonymousVPN