简体   繁体   English

如何使用Java从TCP发送和接收RST标志?

[英]How can I send and receive the RST flag from TCP using Java?

Is it possible to send and receive the RST flag from TCP using Java? 是否可以使用Java从TCP发送和接收RST标志? If is, I would be grateful for some example code. 如果是,我会感谢一些示例代码。

No, it's not possible. 不,这是不可能的。 Java interacts with networking at a different level to the RST flags. Java与RST标志的不同级别的网络交互。

Java allows you to create Sockets with TCP so you are interacting at the Session Level ( Layer 5 in the OSI Model ). Java允许您使用TCP创建套接字,以便在会话级别( OSI模型中的第5层)进行交互。

RST flags are handled by the TCP stack as part of the Transport. RST标志由TCP堆栈作为传输的一部分处理。 So this is usually part of the OS and not handled by the Java VM at all. 所以这通常是操作系统的一部分,完全不由Java VM处理。

The idea is that usually when you're writing code you can create your sockets and not care too much about exactly how they work. 我们的想法是,通常在编写代码时,您可以创建套接字,而不必过多关注它们的工作原理。 If you really want to do some low level network troubleshooting you're going to have to use something other than Java. 如果您真的想要进行一些低级网络故障排除,那么您将不得不使用除Java之外的其他东西。

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

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