public class IOTrio extends Object
close(int, long)
method expressing its intent to close the communication channel. Handlers are notified of this
intent and its up to the handlers to decide what's to be done next. Calling close(int,
long)
does not close the streams or do anything else besides notifying the handlers.Constructor and Description |
---|
IOTrio() |
Modifier and Type | Method and Description |
---|---|
void |
close(int code,
long timeout)
Express an intent to close this communication.
|
InputStream |
getStderr() |
OutputStream |
getStdin() |
InputStream |
getStdout() |
void |
onClose(BiConsumer<Integer,Long> handler)
Capture the CLOSE intent and handle it accordingly.
|
void |
setStderr(InputStream stderr) |
void |
setStdin(OutputStream stdin) |
void |
setStdout(InputStream stdout) |
public InputStream getStdout()
public void setStdout(InputStream stdout)
public InputStream getStderr()
public void setStderr(InputStream stderr)
public OutputStream getStdin()
public void setStdin(OutputStream stdin)
public void onClose(BiConsumer<Integer,Long> handler)
handler
- the handler that's invoked when someone intends to close this communication.
Multiple handlers can be registeredpublic void close(int code, long timeout)
code
- proposed exit codetimeout
- time in milliseconds given to terminate this communication. Negative timeout
means no timeout (i.e. wait for as long as it takes). 0 means "stop it now".Copyright © 2021. All rights reserved.