Class IpcClientTcpEndpoint
- java.lang.Object
-
- org.apache.ignite.internal.util.ipc.loopback.IpcClientTcpEndpoint
-
- All Implemented Interfaces:
Closeable,AutoCloseable,IpcEndpoint
public class IpcClientTcpEndpoint extends Object implements IpcEndpoint
Loopback IPC endpoint based on socket.
-
-
Constructor Summary
Constructors Constructor Description IpcClientTcpEndpoint(String host, int port)Creates and connects client IPC endpoint.IpcClientTcpEndpoint(Socket clientSock)Creates connected client IPC endpoint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes endpoint.InputStreaminputStream()Gets input stream associated with this IPC endpoint.OutputStreamoutputStream()Gets output stream associated with this IPC endpoint.inttimeout()Returns socket timeout.voidtimeout(int ms)Enable/disable socket timeout with specified timeout.
-
-
-
Constructor Detail
-
IpcClientTcpEndpoint
public IpcClientTcpEndpoint(Socket clientSock)
Creates connected client IPC endpoint.- Parameters:
clientSock- Connected client socket.
-
IpcClientTcpEndpoint
public IpcClientTcpEndpoint(String host, int port) throws IgniteCheckedException
Creates and connects client IPC endpoint.- Parameters:
port- Port.host- Host.- Throws:
IgniteCheckedException- If connection fails.
-
-
Method Detail
-
inputStream
public InputStream inputStream() throws IgniteCheckedException
Gets input stream associated with this IPC endpoint.- Specified by:
inputStreamin interfaceIpcEndpoint- Returns:
- IPC input stream.
- Throws:
IgniteCheckedException- If error occurred.
-
outputStream
public OutputStream outputStream() throws IgniteCheckedException
Gets output stream associated with this IPC endpoint.- Specified by:
outputStreamin interfaceIpcEndpoint- Returns:
- IPC output stream.
- Throws:
IgniteCheckedException- If error occurred.
-
close
public void close()
Closes endpoint. Note that IPC endpoint may acquire native resources so it must be always closed once it is not needed.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceIpcEndpoint
-
timeout
public void timeout(int ms) throws SQLExceptionEnable/disable socket timeout with specified timeout.- Parameters:
ms- the specified timeout, in milliseconds.- Throws:
SQLException- if there is an error in the underlying protocol.
-
timeout
public int timeout() throws SQLExceptionReturns socket timeout.- Throws:
SQLException- if there is an error in the underlying protocol.
-
-