简体   繁体   English

如何从Java中已经在我的系统中运行的端口监听数据

[英]how to listen data from a port already running in my system in java

Hi I want to read the data from a port example 1234 which is always listening some application buffers data on that port. 嗨,我想从端口示例1234读取数据,该端口示例始终在侦听该端口上的某些应用程序缓冲区数据。 Now I have to read that port and print data which is buffered on that port in java. 现在,我必须读取该端口并打印在Java中缓冲在该端口上的数据。

Thanks in advance 提前致谢

If I understood your correctly you wish to read information sent to other application that is listening to specific port. 如果我对您的理解正确,则希望阅读发送到正在侦听特定端口的其他应用程序的信息。 If I am right you actually wish to implement sniffer in java. 如果我是对的,您实际上希望在Java中实现嗅探器。

In this case I recommend you to use JPcap: http://jpcap.sourceforge.net/ 在这种情况下,我建议您使用JPcap: http ://jpcap.sourceforge.net/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM