Class IOControl
- java.lang.Object
-
- fr.dyade.aaa.jndi2.msg.IOControl
-
public class IOControl extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classIOControl.NetOutputStream
-
Field Summary
Fields Modifier and Type Field Description private BufferedInputStreambisstatic intDEFAULT_SO_TIMEOUTDefault value for SO_TIMEOUT property.private IOControl.NetOutputStreamnosstatic StringSO_LINGER_PROPThis property allows to enable/disable SO_LINGER with the specified linger time in seconds, if the value is less than 0 then it disables SO_LINGER.static StringSO_REUSE_ADDRESS_PROPThis property allows to enable/disable the SO_REUSEADDR socket option, default is false.static StringSO_TIMEOUT_PROPThis property allows to enable/disable SO_TIMEOUT with the specified timeout in milliseconds, default value is 5.000L (5 seconds).private Socketsocketprivate static intsocketLingerEnable SO_LINGER with the specified linger time in seconds, if the value is less than 0 then it disables SO_LINGER.private static booleansocketReuseAddressEnable/disable the SO_REUSEADDR socket option, default is false.private static intsocketTimeOutEnable/disable SO_TIMEOUT with the specified timeout in milliseconds, default value is 5.000L (5 seconds).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()SocketgetSocket()intreadInt()ObjectreadObject()voidwriteInt(int i)voidwriteObject(Object obj)
-
-
-
Field Detail
-
SO_TIMEOUT_PROP
public static final String SO_TIMEOUT_PROP
This property allows to enable/disable SO_TIMEOUT with the specified timeout in milliseconds, default value is 5.000L (5 seconds).Server side, this property can be fixed either from
javalaunching command, or ina3servers.xmlconfiguration file. Client side, this property can be set in properties of InitialContext.- See Also:
- Constant Field Values
-
DEFAULT_SO_TIMEOUT
public static final int DEFAULT_SO_TIMEOUT
Default value for SO_TIMEOUT property.- See Also:
- Constant Field Values
-
socketTimeOut
private static int socketTimeOut
Enable/disable SO_TIMEOUT with the specified timeout in milliseconds, default value is 5.000L (5 seconds).This value can be adjusted by setting the environment property
fr.dyade.aaa.jndi2.socketTimeOut. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time.
-
SO_LINGER_PROP
public static final String SO_LINGER_PROP
This property allows to enable/disable SO_LINGER with the specified linger time in seconds, if the value is less than 0 then it disables SO_LINGER. Default value is -1.Server side this property can be fixed either from
javalaunching command, or ina3servers.xmlconfiguration file. Client side, this property can be set in properties of InitialContext.- See Also:
- Constant Field Values
-
socketLinger
private static int socketLinger
Enable SO_LINGER with the specified linger time in seconds, if the value is less than 0 then it disables SO_LINGER. Default value is -1.This value can be adjusted by setting the environment property
fr.dyade.aaa.jndi2.socketLinger. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time.
-
SO_REUSE_ADDRESS_PROP
public static final String SO_REUSE_ADDRESS_PROP
This property allows to enable/disable the SO_REUSEADDR socket option, default is false.Server side this property can be fixed either from
javalaunching command, or ina3servers.xmlconfiguration file. Client side, this property can be set in properties of InitialContext.- See Also:
- Constant Field Values
-
socketReuseAddress
private static boolean socketReuseAddress
Enable/disable the SO_REUSEADDR socket option, default is false.This value can be adjusted by setting the environment property
fr.dyade.aaa.jndi2.socketReuseAddress.- See Also:
Socket.setReuseAddress(boolean)
-
socket
private Socket socket
-
bis
private BufferedInputStream bis
-
nos
private IOControl.NetOutputStream nos
-
-
Constructor Detail
-
IOControl
public IOControl(Socket socket, Hashtable env) throws IOException
- Throws:
IOException
-
-
Method Detail
-
readObject
public Object readObject() throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
readInt
public int readInt() throws IOException- Throws:
IOException
-
writeObject
public void writeObject(Object obj) throws IOException
- Throws:
IOException
-
writeInt
public void writeInt(int i) throws IOException- Throws:
IOException
-
close
public void close()
-
getSocket
public final Socket getSocket()
-
-