java.lang.Objectjwrapper.jwutils.JWSockIPC
public class JWSockIPC
Used to reliably and easily set up a Socket (for inter-process communication) between the current process and a child process to be launched by JWSystem. Optionally provides multiple AES encrypted channels layered over the socket.
Method Summary | |
---|---|
static void |
cancelIPC(java.util.Properties launchProperties)
Cancel a previously prepared JWSockIPC |
void |
close()
Close this JWSockIPC and the Socket underlying it |
static JWSockIPC |
connectChild()
Called by the child process to establish a Socket back to the parent process for IPC |
static JWSockIPC |
connectChild(java.lang.String propsprefix)
Called by the child process to establish a Socket back to the parent process for IPC |
static JWSockIPC |
connectParent(java.util.Properties launchProperties)
Called by the parent process after launching the child process to establish the Socket for IPC |
static JWSockIPC |
connectParent(java.lang.String propsprefix,
java.util.Properties launchProperties)
Called by the parent process after launching the child process to establish the Socket for IPC |
static JWSockIPC |
createNewIPC(java.net.Socket sock)
|
java.io.InputStream |
getInChannel(short id)
Get the multiplexed InputStream with the specified ID (-32,768 to 32,767 inclusive) This is paired with the InputStream of the same ID on the opposing Process. |
java.io.OutputStream |
getOutChannel(short id)
Get the multiplexed OutputStream with the specified ID (-32,768 to 32,767 inclusive). |
java.net.Socket |
getRawUnencryptedSocket()
Get the raw Socket set up by JWSockIPC between the parent and child process. |
static void |
setupForIPC(java.util.Properties launchProperties,
boolean aesEncrypted)
Set up a child process for JWSockIPC by configuring its launch properties |
static void |
setupForIPC(java.lang.String propsprefix,
java.util.Properties launchProperties,
boolean aesEncrypted)
Set up a child process for JWSockIPC by configuring its launch properties |
void |
setupMultipleChannels()
Set up multiplexing on the Socket to split it into multiple (63355) in/out channels (InputStream/OutputStream pairs). |
void |
setupPingsAndReportClosure(JWSockIPCListener listener,
short channel,
long timeoutMS)
Set up pings (keepalive) on a multiplexed channel (e.g. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static void cancelIPC(java.util.Properties launchProperties)
launchProperties
- public void close()
public static JWSockIPC connectChild() throws java.io.IOException
java.io.IOException
public static JWSockIPC connectChild(java.lang.String propsprefix) throws java.io.IOException
java.io.IOException
public static JWSockIPC connectParent(java.util.Properties launchProperties) throws java.io.IOException
launchProperties
-
java.io.IOException
public static JWSockIPC connectParent(java.lang.String propsprefix, java.util.Properties launchProperties) throws java.io.IOException
launchProperties
-
java.io.IOException
public static JWSockIPC createNewIPC(java.net.Socket sock)
public java.io.InputStream getInChannel(short id)
id
-
public java.io.OutputStream getOutChannel(short id)
id
-
public java.net.Socket getRawUnencryptedSocket()
public static void setupForIPC(java.util.Properties launchProperties, boolean aesEncrypted) throws java.io.IOException
launchProperties
-
java.io.IOException
public static void setupForIPC(java.lang.String propsprefix, java.util.Properties launchProperties, boolean aesEncrypted) throws java.io.IOException
launchProperties
-
java.io.IOException
public void setupMultipleChannels() throws java.io.IOException
java.io.IOException
public void setupPingsAndReportClosure(JWSockIPCListener listener, short channel, long timeoutMS)
listener,
- can be nullchannel
- the multiplexed channel to set up pings on.timeoutMS
- public java.lang.String toString()
toString
in class java.lang.Object