Java Broken pipe Exception 是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3751661/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 04:22:44  来源:igfitidea点击:

what is the meaning of Broken pipe Exception?

java

提问by varakumar.pjd

what is the meaning of broken pipe exception and when it will come?

断管异常是什么意思,什么时候会出现?

采纳答案by Erick Robertson

A pipe is a data stream, typically data being read from a file or from a network socket. A broken pipe occurs when this pipe is suddenly closed from the other end. For a flie, this could be if the file is mounted on a disc or a remote network which has become disconnected. For a network socket, it could be if the network gets unplugged or the process on the other end crashes.

管道是一种数据流,通常是从文件或网络套接字中读取的数据。当管道从另一端突然关闭时,就会发生管道破裂。对于苍蝇,这可能是文件安装在已断开连接的光盘或远程网络上。对于网络套接字,可能是网络被拔掉或另一端的进程崩溃。

In Java, there is no BrokenPipeExceptionspecifically. This type of error will be found wrapped in a different exception, such as a SocketExceptionor IOException.

在Java中,没有BrokenPipeException专门的。这种类型的错误会被发现包含在不同的异常中,例如 aSocketExceptionIOException

回答by Rohith

Pipe is basically a communication channel between two processes. So one process writes to the pipe while the other reads from it. A broken pipe exception typically means that one process is attempting to read or writ data from a pipe, where as the process on the other end of the pipe has died/been killed.

管道基本上是两个进程之间的通信通道。因此,一个进程写入管道,而另一个进程从中读取。管道损坏异常通常意味着一个进程正在尝试从管道读取或写入数据,而管道另一端的进程已死亡/被杀死。

回答by Arrabi

I think you are using Java.net ?

我认为您正在使用 Java.net ?

If you closed the connection, then you need to open a new socket before you can send more data.

如果您关闭了连接,那么您需要打开一个新的套接字才能发送更多数据。

or your connections is been rejected

或者您的连接被拒绝