Reputation: 254
im a newbie in android. I would like to ask if anybody knows why i'm getting this "connection refused" IOException when i try to establish a TCP/IP connection between two android device. I tried to ping both device and they are responding. Anybody please... Thanks in advance...
E/TCP_IP connect thread( 7466): java.net.ConnectException: /192.168.4.100:8080 - Connection refused
E/TCP_IP connect thread( 7466): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:254)
E/TCP_IP connect thread( 7466): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:219)
E/TCP_IP connect thread( 7466): at java.net.Socket.startupSocket(Socket.java:781)
E/TCP_IP connect thread( 7466): at java.net.Socket.<init>(Socket.java:316)
E/TCP_IP connect thread( 7466): at com.neugent.WIFI.TCP_IP$ConnectThread.run(TCP_IP.java:291)
Upvotes: 0
Views: 4002
Reputation: 8790
If it's the missing INTERNET permission, add this line to your Android.manifest
file just above the <application>
tag.
<uses-permission android:name="android.permission.INTERNET/>
Upvotes: 3
Reputation: 77732
You don't have the INTERNET permission? That, or your Wifi isn't turned on or the other IP isn't accessible (like you're trying to connect to a LAN IP via WAN).
Upvotes: 1