本文介绍了在Android的SCTP协议​​支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用Android的SCTP协议​​?

How can I use SCTP protocol in Android?

我已经知道了Android的系统不支持SCTP在默认情况下,但它可能会通过插入SCTP内核模块或重建与SCTP模块配置中启用内核来启用它。

I'm already aware that that Android systems don't support SCTP by default, however it's may be possible to enable it by inserting SCTP kernel module, or rebuilding the kernel with SCTP enabled in modules configuration.

我需要在这个问题上的一些见解。可能吗?如何让Android支持的协议?如何构建内核模块,并正确地插入呢?如果我们能够在使系统支持的话,我们如何使用该协议成功吗?关于是否支持Android SCTP Java API的?

I need some insight on this issue. Is it possible? How to make android support the protocol? How to build kernel module and insert it correctly? If we could succeed in making the system to support it, how we can use the protocol? Does the Java API on android support SCTP?

推荐答案

绕了一个模块是正确的方式。要回答你的问题:

Going about it with a module is the right way. To answer your questions:

  • SCTP已经提供的Linux源代码树的内核模块 - CONFIG_IP_SCTP = M将使该模块。你可以更改为Y来硬链接,虽然这可能是不可行的,因为你不得不重建整个内核的。

  • SCTP is already provided as a kernel module in the Linux source tree - "CONFIG_IP_SCTP=m" would enable that module. And you can change that to a "y" to hard link, though that is probably unfeasible, since you'd have to rebuild the entire kernel for that.

该模块将不得不仍然每个内核版本内置。所以基本上每个供应商,你需要得到他们的内核源代码(可行),然后编译反对你的模块。

The module would have to still be built per kernel version. So basically per vendor, you'd need to get their kernel sources (doable), and then compile your module against it.

要使用:在用户模式 ​​- 将通过调用创建套接字s =插座(AF_INET [6],SOCK_STREAM,IPPROTO_SCTP);从这一点来说,接口的API的工作完全一样,也有少数例外(即setsockopt的,这是特别为协议类型)。

To use: In User mode - would create the socket by calling s = socket (AF_INET[6], SOCK_STREAM, IPPROTO_SCTP); From that point, socket APIs work exactly the same, with a few exceptions (namely setsockopt, which is particular for the protocol type).

从Java - 事实上确实支持它的最新版本协议(JDK7作为里程碑3),但Java的支持并不意味着的Dalvik(Android系统的Java虚拟机)一样。虽然Android的做就绪有SCTP的支持,它尚未在Dalvik的(至少在4.2)。您可以创建一个Java类,但是,作为一个包,将包上SCTP调用本机库。这是一个有点棘手的净权限的Andr​​oid的原因,但仍在可控范围(从经验中)。

From Java - does in fact support the protocol in its latest incarnations (JDK7 as of milestone 3), but that Java supports it doesn't mean that Dalvik (the "java vm" of Android) does. Though Android does have SCTP support "in the ready", it's not yet in Dalvik (at least not in 4.2). You could create a Java class, though, as in a package, that would wrap a native library with SCTP calls. It's a bit trickier in Android because of the NET permissions, but still manageable (from experience).

这篇关于在Android的SCTP协议​​支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-08 08:40