com.maverick.nio
Class ProtocolContext

java.lang.Object
  extended by com.maverick.nio.ProtocolContext

public abstract class ProtocolContext
extends Object

A protocol context defines the behaviour for a listening interface.

Author:
Lee David Painter

Field Summary
protected  boolean keepAlive
           
protected  int receiveBufferSize
           
protected  boolean reuseAddress
           
protected  int sendBufferSize
           
protected  boolean tcpNoDelay
           
 
Constructor Summary
ProtocolContext()
           
 
Method Summary
 int getReceiveBufferSize()
          Get the socket receive buffer size.
 int getSendBufferSize()
          Get the socket send buffer size.
 boolean getSocketOptionKeepAlive()
          Indicates whether the SO_KEEPALIVE socket option is set on connected sockets.
 boolean getSocketOptionReuseAddress()
          Indicates whether the SO_REUSEADDR socket option will be set on a server socket.
 boolean getSocketOptionTcpNoDelay()
          Indicates whether the TCP_NODELAY socket option is set on connected sockets.
 void setReceiveBufferSize(int receiveBufferSize)
          Set the receive buffer size for sockets.
 void setSendBufferSize(int sendBufferSize)
          Set the send buffer size for sockets.
 void setSocketOptionKeepAlive(boolean keepAlive)
          Set the SO_KEEPALIVE socket option on connected sockets.
 void setSocketOptionReuseAddress(boolean reuseAddress)
          Indicates whether the SO_REUSEADDR socket option will be set on a server socket.
 void setSocketOptionTcpNoDelay(boolean tcpNoDelay)
          Set the TCP_NODELAY socket option on connected sockets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keepAlive

protected boolean keepAlive

tcpNoDelay

protected boolean tcpNoDelay

reuseAddress

protected boolean reuseAddress

receiveBufferSize

protected int receiveBufferSize

sendBufferSize

protected int sendBufferSize
Constructor Detail

ProtocolContext

public ProtocolContext()
Method Detail

getSocketOptionKeepAlive

public boolean getSocketOptionKeepAlive()
Indicates whether the SO_KEEPALIVE socket option is set on connected sockets.

Returns:
boolean

getSocketOptionReuseAddress

public boolean getSocketOptionReuseAddress()
Indicates whether the SO_REUSEADDR socket option will be set on a server socket.

Returns:
boolean

setSocketOptionReuseAddress

public void setSocketOptionReuseAddress(boolean reuseAddress)
Indicates whether the SO_REUSEADDR socket option will be set on a server socket.

Parameters:
reuseAddress - boolean

setSocketOptionKeepAlive

public void setSocketOptionKeepAlive(boolean keepAlive)
Set the SO_KEEPALIVE socket option on connected sockets.

Parameters:
keepAlive - boolean

getSocketOptionTcpNoDelay

public boolean getSocketOptionTcpNoDelay()
Indicates whether the TCP_NODELAY socket option is set on connected sockets.

Returns:
boolean

setSocketOptionTcpNoDelay

public void setSocketOptionTcpNoDelay(boolean tcpNoDelay)
Set the TCP_NODELAY socket option on connected sockets.

Parameters:
tcpNoDelay - boolean

setReceiveBufferSize

public void setReceiveBufferSize(int receiveBufferSize)
Set the receive buffer size for sockets.

Parameters:
receiveBufferSize - int

setSendBufferSize

public void setSendBufferSize(int sendBufferSize)
Set the send buffer size for sockets.

Parameters:
sendBufferSize - int

getReceiveBufferSize

public int getReceiveBufferSize()
Get the socket receive buffer size.

Returns:
int

getSendBufferSize

public int getSendBufferSize()
Get the socket send buffer size.

Returns:
int


Copyright © 2012. All Rights Reserved.