org.apache.ignite.internal.util.ipc.shmem

## Class IpcSharedMemoryClientEndpoint

- java.lang.Object
- - org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryClientEndpoint

All Implemented Interfaces:
  Closeable, AutoCloseable, IpcEndpoint

    public class IpcSharedMemoryClientEndpoint
    extends Object
    implements IpcEndpoint

IPC endpoint based on shared memory space.

### Constructor Summary

Constructors
Constructor and Description
`IpcSharedMemoryClientEndpoint(int port, IgniteLogger parent)` Creates and connects client IPC endpoint and starts background checker thread to avoid deadlocks on other party crash.
`IpcSharedMemoryClientEndpoint(int port, int timeout, IgniteLogger parent)` Creates and connects client IPC endpoint and starts background checker thread to avoid deadlocks on other party crash.
`IpcSharedMemoryClientEndpoint(IpcSharedMemorySpace inSpace, IpcSharedMemorySpace outSpace, IgniteLogger parent)` Creates connected client IPC endpoint.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` Closes endpoint.
`void` `forceClose()` Forcibly closes spaces and frees all system resources.
`InputStream` `inputStream()` Gets input stream associated with this IPC endpoint.
`OutputStream` `outputStream()` Gets output stream associated with this IPC endpoint.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### IpcSharedMemoryClientEndpoint

    public IpcSharedMemoryClientEndpoint(IpcSharedMemorySpace inSpace,
                                         IpcSharedMemorySpace outSpace,
                                         IgniteLogger parent)

Creates connected client IPC endpoint.

Parameters:
  `inSpace` - In space.
  `outSpace` - Out space.
  `parent` - Parent logger.

#### IpcSharedMemoryClientEndpoint

    public IpcSharedMemoryClientEndpoint(int port,
                                         IgniteLogger parent)
                                  throws IgniteCheckedException

Creates and connects client IPC endpoint and starts background checker thread to avoid deadlocks on other party crash. Waits until port became available.

Parameters:
  `port` - Port server endpoint bound to.
  `parent` - Parent logger.
Throws:
  `IgniteCheckedException` - If connection fails.

#### IpcSharedMemoryClientEndpoint

    public IpcSharedMemoryClientEndpoint(int port,
                                         int timeout,
                                         IgniteLogger parent)
                                  throws IgniteCheckedException

Creates and connects client IPC endpoint and starts background checker thread to avoid deadlocks on other party crash.

Parameters:
  `port` - Port server endpoint bound to.
  `timeout` - Connection timeout.
  `parent` - Parent logger.
Throws:
  `IgniteCheckedException` - If connection fails.

### Method Detail

#### inputStream

    public InputStream inputStream()

Gets input stream associated with this IPC endpoint.

Specified by:
  `inputStream` in interface `IpcEndpoint`
Returns:
  IPC input stream.

#### outputStream

    public OutputStream outputStream()

Gets output stream associated with this IPC endpoint.

Specified by:
  `outputStream` in interface `IpcEndpoint`
Returns:
  IPC output stream.

#### 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:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `IpcEndpoint`

#### forceClose

    public void forceClose()

Forcibly closes spaces and frees all system resources.

This method should be called with caution as it may result to the other-party process crash. It is intended to call when there was an IO error during handshake and other party has not yet attached to the space.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019