使用 jNetPcap 绑定到某个端口
我正在使用 java 语言和 jNetPcap 库。我想知道如何绑定到5060端口。我必须制作一个服务器程序。所以我的愿景是这样的:
- 绑定到端口 5060
- 获取所有前往我的服务器 ip 的数据包,并且该端口
- 将它们加载到 jnetpcap 中的 Sip 结构 完毕。
如果我将所有数据包作为 Sip 发送到端口 5060,我会非常满意。
你能帮助我吗?
I am using java language with jNetPcap library. I would like to know how can I bind to port 5060. I have to make a server program. So my vision is like that:
- bind to port 5060
- get all packets which are going to my server ip and this port
- load them to Sip structure in jnetpcap
done.
I will be so satisfied if I get all the packets going to port 5060 as Sip.
can you help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来 javadoc 在开发人员的网站上不可用。我首先会向他们发送一封电子邮件,询问他们是否可以提供它们,因为他们似乎没有共享源代码。
如果失败的话,看起来像这个链接: http://jnetpcap.com/tutorial/usage,你在数据包本身上设置端口,而不是在打开连接时设置端口。
如果失败,请将 JAR 添加到 Java IDE 中的项目中,让它解析类并向您显示哪些对象可用以及这些对象中哪些方法可用。
您也许能够从他们的示例页面中收集足够的信息。
祝你好运。
It looks like the javadocs are not available on the developer's website. I would start by sending them an email asking if they can make them available as they do not appear to be sharing their source code.
Failing that, it looks like from this link: http://jnetpcap.com/tutorial/usage, you set the port on the packet itself, rather than when you open a connection.
Failing that, add the JAR to a project in a Java IDE to let it parse the classes and show you what objects are available and what methods are available in those objects.
You might be able to glean enough information from their examples pages.
Good luck.