|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinfoservice.mailsystem.central.server.util.SocketContainer
public class SocketContainer
This class enables usage of alternative input and output streams for a socket.
| Field Summary | |
|---|---|
private java.io.InputStream |
m_alternativeInputStream
Stores an alternative input stream. |
private java.io.OutputStream |
m_alternativeOutputStream
Stores an alternative output stream. |
private java.net.Socket |
m_socket
Stores the origin socket. |
| Constructor Summary | |
|---|---|
SocketContainer(java.net.Socket a_socket,
java.io.InputStream a_alternativeInputStream,
java.io.OutputStream a_alternativeOutputStream)
Creates a new instance of SocketContainer. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the socket, see Socket.close(). |
SocketContainer |
createChildContainer(java.io.InputStream a_alternativeInputStream,
java.io.OutputStream a_alternativeOutputStream)
Creates a child of this SocketContainer. |
java.io.InputStream |
getInputStream()
Returns the InputStream to use. |
java.io.OutputStream |
getOutputStream()
Returns the OutputStream to use. |
void |
setSocketTimeout(int a_timeout)
Changes the timeout for the underlying socket. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.net.Socket m_socket
private java.io.InputStream m_alternativeInputStream
private java.io.OutputStream m_alternativeOutputStream
| Constructor Detail |
|---|
public SocketContainer(java.net.Socket a_socket,
java.io.InputStream a_alternativeInputStream,
java.io.OutputStream a_alternativeOutputStream)
a_socket - The underlying socket to use.a_alternativeInputStream - Specifies an alternative InputStream the SocketContainer
shall use. If null is specified, it will use the InputStream
of the socket itself.a_alternativeOutputStream - Specifies an alternative OutputStream the SocketContainer
shall use. If null is specified, it will use the
OutputStream of the socket itself.| Method Detail |
|---|
public java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOException
public java.io.OutputStream getOutputStream()
throws java.io.IOException
java.io.IOException
public void close()
throws java.io.IOException
java.io.IOException
public void setSocketTimeout(int a_timeout)
throws java.net.SocketException
a_timeout - The timeout for the socket in ms. If 0 is specified, no timeout is used.
java.net.SocketException
public SocketContainer createChildContainer(java.io.InputStream a_alternativeInputStream,
java.io.OutputStream a_alternativeOutputStream)
throws java.io.IOException
a_alternativeInputStream - Specifies an alternative InputStream the child shall use. If
null is specified, it will use the InputStream returned by
getInputStream().a_alternativeOutputStream - Specifies an alternative OutputStream the child shall use.
If null is specified, it will use the OutputStream returned
by getOutputStream().
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||