连接被拒绝:IOException异常android系统中TCP / IP [英] Connection Refused : IOException in android TCP/IP

查看:327
本文介绍了连接被拒绝:IOException异常android系统中TCP / IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时通讯在Android中一个新手。我想问一下,如果有人知道这是为什么我得到这个连接被拒绝IOException异常,当我尝试建立两个Android设备之间的TCP / IP连接。我试图平器件和他们响应。有人请...
在此先感谢...

  E / TCP_IP连接线(7466):java.net.ConnectException:/192.168.4.100:8080  - 连接被拒绝
E / TCP_IP连接线(7466):在org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:254)
E / TCP_IP连接线(7466):在org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:219)
E / TCP_IP连接线(7466):在java.net.Socket.startupSocket(Socket.java:781)
E / TCP_IP连接线(7466):在java.net.Socket中的<&初始化GT;(Socket.java:316)。
E / TCP_IP连接线(7466):在com.neugent.WIFI.TCP_IP $ ConnectThread.run(TCP_IP.java:291)


解决方案

如果这是缺失的INTERNET权限,这条线添加到您的 Android.manifest 文件略高于<应用> 标记。

<使用许可权的android:NAME =android.permission.INTERNET对/>

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)

解决方案

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/>

这篇关于连接被拒绝:IOException异常android系统中TCP / IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆