public class JslipcPipeClient extends Object implements TimeoutAware
JslipcPipeServer
. Method connect(Class...)
requests a new
connection and waits for the server response.Constructor and Description |
---|
JslipcPipeClient(File serverDirectory)
Creates a client talking to the
JslipcPipeServer on the given
directory. |
Modifier and Type | Method and Description |
---|---|
JslipcPipe |
connect(Class<? extends JslipcPipe>... acceptedTypes)
Requests and waits for a pipe created by the corresponding
JslipcPipeServer |
JslipcPipe |
connect(JslipcRequest request)
Requests and waits for a pipe created by the corresponding
JslipcPipeServer |
protected JslipcRequest |
createRequest(Class<? extends JslipcPipe>... acceptedTypes)
Creates a JslipcRequest for the given accept-types.
|
File |
getServerDirectory() |
int |
getTimeout() |
protected JslipcPipe |
readResponse(InputStream in)
Reads the response from the server and creates the pipe.
|
protected void |
sendRequest(OutputStream out,
JslipcRequest request)
Writes a request for a pipe to the given OutputStream.
|
void |
setTimeout(int timeout)
Sets the connect-timeout of the client.
|
String |
toString() |
public JslipcPipeClient(File serverDirectory) throws IOException
JslipcPipeServer
on the given
directory.serverDirectory
- the JslipcPipeServer directory.IOException
public File getServerDirectory()
public JslipcPipe connect(Class<? extends JslipcPipe>... acceptedTypes) throws IOException
JslipcPipeServer
acceptedTypes
- the pipe types accepted by the client.IOException
public JslipcPipe connect(JslipcRequest request) throws IOException
JslipcPipeServer
request
- the request to send.IOException
protected void sendRequest(OutputStream out, JslipcRequest request) throws IOException
out
- the stream to write to.request
- the request to write.IOException
protected JslipcRequest createRequest(Class<? extends JslipcPipe>... acceptedTypes) throws IOException
acceptedTypes
- IOException
protected JslipcPipe readResponse(InputStream in) throws IOException
in
- the stream to read from.IOException
public int getTimeout()
getTimeout
in interface TimeoutAware
public void setTimeout(int timeout)
setTimeout
in interface TimeoutAware
timeout
- the timeout in ms.Copyright © 2014. All Rights Reserved.