public class SharedMemorySocket
extends java.net.Socket
Modifier and Type | Class and Description |
---|---|
static interface |
SharedMemorySocket.Advapi32 |
static interface |
SharedMemorySocket.Kernel32 |
(package private) class |
SharedMemorySocket.SharedMemoryInputStream |
(package private) class |
SharedMemorySocket.SharedMemoryOutputStream |
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BUFFERLEN |
private int |
bytesLeft |
private com.sun.jna.platform.win32.WinNT.HANDLE |
clientRead |
private com.sun.jna.platform.win32.WinNT.HANDLE |
clientWrote |
private com.sun.jna.platform.win32.WinNT.HANDLE |
connectionClosed |
static java.lang.String |
EVERYONE_SYNCHRONIZE_SDDL |
(package private) java.io.InputStream |
is |
private java.lang.String |
memoryName |
(package private) java.io.OutputStream |
os |
private int |
position |
private com.sun.jna.platform.win32.WinNT.HANDLE |
serverRead |
private com.sun.jna.platform.win32.WinNT.HANDLE |
serverWrote |
private int |
timeout |
private com.sun.jna.Pointer |
view |
(package private) static java.util.Map<java.lang.String,java.lang.Object> |
WIN32API_OPTIONS |
Constructor and Description |
---|
SharedMemorySocket(java.lang.String name)
Create ShareMemorySocket.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
connect(java.net.SocketAddress endpoint) |
void |
connect(java.net.SocketAddress endpoint,
int timeout) |
int |
getConnectNumber() |
java.io.InputStream |
getInputStream() |
java.io.OutputStream |
getOutputStream() |
private com.sun.jna.platform.win32.WinNT.HANDLE |
lockMutex() |
static com.sun.jna.Pointer |
mapMemory(java.lang.String mapName,
int mode,
int size)
Map memory
|
static com.sun.jna.platform.win32.WinNT.HANDLE |
openEvent(java.lang.String name) |
void |
setKeepAlive(boolean b) |
void |
setReceiveBufferSize(int size) |
void |
setSendBufferSize(int size) |
void |
setSoLinger(boolean b,
int i) |
void |
setSoTimeout(int t) |
void |
setTcpNoDelay(boolean b) |
void |
shutdownInput() |
void |
shutdownOutput() |
bind, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setPerformancePreferences, setReuseAddress, setSocketImplFactory, setTrafficClass, toString
public static final java.lang.String EVERYONE_SYNCHRONIZE_SDDL
static final java.util.Map<java.lang.String,java.lang.Object> WIN32API_OPTIONS
static int BUFFERLEN
java.io.InputStream is
java.io.OutputStream os
private java.lang.String memoryName
private com.sun.jna.platform.win32.WinNT.HANDLE serverRead
private com.sun.jna.platform.win32.WinNT.HANDLE serverWrote
private com.sun.jna.platform.win32.WinNT.HANDLE clientRead
private com.sun.jna.platform.win32.WinNT.HANDLE clientWrote
private com.sun.jna.platform.win32.WinNT.HANDLE connectionClosed
private com.sun.jna.Pointer view
private int bytesLeft
private int position
private int timeout
public SharedMemorySocket(java.lang.String name) throws java.io.IOException
name
- namejava.io.IOException
- exceptionpublic static com.sun.jna.platform.win32.WinNT.HANDLE openEvent(java.lang.String name)
public static com.sun.jna.Pointer mapMemory(java.lang.String mapName, int mode, int size)
mapName
- map namemode
- modesize
- sizepublic void connect(java.net.SocketAddress endpoint) throws java.io.IOException
connect
in class java.net.Socket
java.io.IOException
private com.sun.jna.platform.win32.WinNT.HANDLE lockMutex() throws java.io.IOException
java.io.IOException
public int getConnectNumber() throws java.io.IOException
java.io.IOException
public void connect(java.net.SocketAddress endpoint, int timeout) throws java.io.IOException
connect
in class java.net.Socket
java.io.IOException
public java.io.InputStream getInputStream()
getInputStream
in class java.net.Socket
public java.io.OutputStream getOutputStream()
getOutputStream
in class java.net.Socket
public void setTcpNoDelay(boolean b)
setTcpNoDelay
in class java.net.Socket
public void setKeepAlive(boolean b)
setKeepAlive
in class java.net.Socket
public void setReceiveBufferSize(int size)
setReceiveBufferSize
in class java.net.Socket
public void setSendBufferSize(int size)
setSendBufferSize
in class java.net.Socket
public void setSoLinger(boolean b, int i)
setSoLinger
in class java.net.Socket
public void setSoTimeout(int t)
setSoTimeout
in class java.net.Socket
public void shutdownInput()
shutdownInput
in class java.net.Socket
public void shutdownOutput()
shutdownOutput
in class java.net.Socket
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.net.Socket