public class ProxyTcpSessionConfig extends Object implements TcpSessionConfig
Constructor and Description |
---|
ProxyTcpSessionConfig(Socket socket) |
Modifier and Type | Method and Description |
---|---|
long |
getIdleTimeInMillis(IdleStatus status)
Returns idle time for the specified type of idleness in milli-seconds.
|
Integer |
getReadBufferSize()
Returns the size of the read buffer that I/O processor allocates
per each read.
|
Integer |
getSendBufferSize() |
Integer |
getSoLinger()
Please note that enabling SO_LINGER in Java NIO can result
in platform-dependent behavior and unexpected blocking of I/O thread.
|
SSLContext |
getSslContext() |
Integer |
getTimeout()
Get the SO_TIMEOUT set for this socket
|
int |
getTrafficClass() |
Boolean |
isKeepAlive() |
Boolean |
isOobInline() |
Boolean |
isReuseAddress() |
boolean |
isSecured()
Tells if the session provides some encryption (SSL/TLS)
|
Boolean |
isTcpNoDelay() |
void |
setIdleTimeInMillis(IdleStatus status,
long ildeTimeInMilli)
Set the delay before an
IoSession is considered idle for a given
operation type (read/write/both) @see IdleStatus |
void |
setKeepAlive(boolean keepAlive) |
void |
setOobInline(boolean oobInline) |
void |
setReadBufferSize(int receiveBufferSize)
Sets the size of the read buffer that I/O processor allocates
per each read.
|
void |
setReuseAddress(boolean reuseAddress) |
void |
setSendBufferSize(int sendBufferSize)
Sets the size of the buffer that I/O processor allocates
per each write.
|
void |
setSoLinger(int soLinger)
Please note that enabling SO_LINGER in Java NIO can result
in platform-dependent behavior and unexpected blocking of I/O thread.
|
void |
setSslContext(SSLContext sslContext) |
void |
setTcpNoDelay(boolean tcpNoDelay) |
void |
setTimeout(int timeout)
Sets the SO_TIMEOUT option for this socket
|
void |
setTrafficClass(int trafficClass)
Set the ToS flag for this session
|
void |
setTrafficClass(TrafficClassEnum trafficClass)
Set the ToS flag for this session
|
public ProxyTcpSessionConfig(Socket socket)
public long getIdleTimeInMillis(IdleStatus status)
getIdleTimeInMillis
in interface IoSessionConfig
-1
if no idle time configured for this statusIdleStatus
public void setIdleTimeInMillis(IdleStatus status, long ildeTimeInMilli)
IoSession
is considered idle for a given
operation type (read/write/both) @see IdleStatussetIdleTimeInMillis
in interface IoSessionConfig
status
- the type of idle (read/write/both) timeout to setildeTimeInMilli
- the timeout in milliseconds (-1
for no idle detection on this status)public Boolean isTcpNoDelay()
isTcpNoDelay
in interface TcpSessionConfig
Socket.getTcpNoDelay()
public void setTcpNoDelay(boolean tcpNoDelay)
setTcpNoDelay
in interface TcpSessionConfig
Socket.setTcpNoDelay(boolean)
public Boolean isReuseAddress()
isReuseAddress
in interface IoSessionConfig
Socket.getReuseAddress()
public void setReuseAddress(boolean reuseAddress)
setReuseAddress
in interface IoSessionConfig
Socket.setReuseAddress(boolean)
,
return null
if the default system value is used
public Integer getReadBufferSize()
getReadBufferSize
in interface IoSessionConfig
public void setReadBufferSize(int receiveBufferSize)
setReadBufferSize
in interface IoSessionConfig
receiveBufferSize
- The buffer size used to read data from the socketpublic Integer getSendBufferSize()
getSendBufferSize
in interface IoSessionConfig
DatagramSocket.getSendBufferSize()
public void setSendBufferSize(int sendBufferSize)
setSendBufferSize
in interface IoSessionConfig
sendBufferSize
- The buffer size used to send data into the socketpublic int getTrafficClass()
getTrafficClass
in interface IoSessionConfig
Socket.getTrafficClass()
public void setTrafficClass(int trafficClass)
setTrafficClass
in interface IoSessionConfig
trafficClass
- The ToS to setSocket.setTrafficClass(int)
public void setTrafficClass(TrafficClassEnum trafficClass)
setTrafficClass
in interface IoSessionConfig
trafficClass
- The ToS to setSocket.setTrafficClass(int)
public Boolean isKeepAlive()
isKeepAlive
in interface TcpSessionConfig
return null
if the default system value is used
public void setKeepAlive(boolean keepAlive)
setKeepAlive
in interface TcpSessionConfig
Socket.setKeepAlive(boolean)
public Boolean isOobInline()
isOobInline
in interface TcpSessionConfig
return null
if the default system value is used
public void setOobInline(boolean oobInline)
setOobInline
in interface TcpSessionConfig
Socket.setOOBInline(boolean)
public Integer getSoLinger()
getSoLinger
in interface TcpSessionConfig
Socket.getSoLinger()
,
Sun Bug Database
return null
if the default system value is usedpublic void setSoLinger(int soLinger)
setSoLinger
in interface TcpSessionConfig
soLinger
- Please specify a negative value to disable SO_LINGER.Socket.setSoLinger(boolean, int)
,
Sun Bug Databasepublic boolean isSecured()
isSecured
in interface TcpSessionConfig
true
if the session is securedpublic SSLContext getSslContext()
getSslContext
in interface TcpSessionConfig
SSLContext
instance stored in the configuration.public void setSslContext(SSLContext sslContext)
setSslContext
in interface TcpSessionConfig
public Integer getTimeout()
getTimeout
in interface IoSessionConfig
Socket.getSoTimeout()
,
DatagramSocket.getSoTimeout()
public void setTimeout(int timeout)
setTimeout
in interface IoSessionConfig
timeout
- The timeout to set, in milliseconds. 0 means infiniteSocket.setSoTimeout(int)
,
DatagramSocket.setSoTimeout(int)
Copyright © 2009–2013 Apache MINA Project. All rights reserved.