在Android原始套接字 [英] Raw Sockets on Android

查看:300
本文介绍了在Android原始套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个运行在Android和使用原始套接字的应用程序。我看到有没有在java.net。*或android.net任何原始套接字支持。*库。是原始套接字在Android可能吗?

I want to create an application that runs on Android and uses Raw Sockets. I see there isn't any raw socket support in the java.net.* or the android.net.* libraries. Are raw sockets possible on Android?

推荐答案

正确的,原始套接字不支持任何Java或者Android库,部分原因是(我从引用的这里):

Correct, raw sockets are not supported in any Java or Android libraries, in part because (I quote from here):

据信这样的包   会降低当前的Java   安全模式与可能难以   在非操作系统实现   (OS)相关的方式。

it is believed that such a package would degrade the current Java security model and may be difficult to implement in a non-operating system (OS) dependent fashion.

有像 RockSaw 或的JSocket ,但这些都需要编译C或C ++,那么你的运气那里。

There are 3rd party libraries like RockSaw or JSocket, however these require compiling C or C++, so you are out of luck there.

另外,我相信你需要root访问权限才能使用原始套接字。

Also, I believe you need root access to use raw sockets.

于是,有了这一切,我会说在技术上是可行的,但不实际在这个时候。

So, with all that, I would say technically it's possible, but not practical at this time.

这篇关于在Android原始套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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