Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Showcase on capturing and making use of SIG_PIPE
import sun.misc.Signal;
import sun.misc.SignalHandler;
* Demo on making use of SIG_PIPE
public class RespectSigPipe
static boolean isPipeRecieved = false;
public RespectSigPipe() {
Signal.handle(new Signal("PIPE"), new SignalHandler() {
public void handle(Signal arg0) {
isPipeRecieved = true;
private void printToInfinite()
System.out.println( "Hello World!!!");
public static void main( String[] args )
RespectSigPipe demo = new RespectSigPipe();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment