|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.net.Socket
CADI.Client.Network.ClientSocket
public class ClientSocket
This class inherits the Socket adding new useful methods
and other ones has been overrided and adapted to new requirements.
| Field Summary | |
|---|---|
private boolean |
connected
|
static int |
DEFAULT_PORT
The default port. |
private int |
DEFAULT_TIMEOUT
|
private int |
port
It is the server port where request must be sent. |
private java.lang.String |
server
Contains the JPIP server name. |
private int |
timeout
|
| Constructor Summary | |
|---|---|
ClientSocket()
|
|
| Method Summary | |
|---|---|
void |
close()
|
void |
connect(java.lang.String server)
Opens a connection between the client and the server. |
void |
connect(java.lang.String server,
int port)
Opens a connection between the client and the server. |
void |
connect(java.lang.String server,
int port,
int timeout)
Opens a connection between the client and the server. |
java.io.InputStream |
getInputStream()
|
java.io.OutputStream |
getOutputStream()
|
java.lang.String |
getRemoteHost()
Returns the name of the endpoint this client is connected to, or null if it is unconnected. |
boolean |
isConnected()
|
void |
list(java.io.PrintStream out)
Prints this ClientSocket out to the specified output stream. |
void |
reconnect()
Reconnects the socket using the last server, port, and timeout. |
void |
setSoTimeout(int timeout)
|
java.lang.String |
toString()
For debugging purposes. |
| Methods inherited from class java.net.Socket |
|---|
bind, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String server
private int port
public static final int DEFAULT_PORT
private int timeout
private int DEFAULT_TIMEOUT
private boolean connected
| Constructor Detail |
|---|
public ClientSocket()
| Method Detail |
|---|
public void connect(java.lang.String server)
throws java.io.IOException
close() method is called.
server - the server name.
java.io.IOException - an IOException will be thrown is the connection
can not be opened.
public void connect(java.lang.String server,
int port)
throws java.io.IOException
close() method is called.
server - port -
java.io.IOException - an IOException will be thrown is the connection
can not be opened.
public void connect(java.lang.String server,
int port,
int timeout)
throws java.io.IOException
close() method is called.
server - port - timeout -
java.io.IOException - an IOException will be thrown is the connection
can not be opened.
public void reconnect()
throws java.io.IOException
java.io.IOExceptionpublic void close()
close in class java.net.Socketpublic boolean isConnected()
isConnected in class java.net.Socket
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class java.net.Socketjava.io.IOException
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class java.net.Socketjava.io.IOExceptionpublic java.lang.String getRemoteHost()
public void setSoTimeout(int timeout)
throws java.net.SocketException
setSoTimeout in class java.net.Socketjava.net.SocketExceptionpublic java.lang.String toString()
toString in class java.net.Socketpublic void list(java.io.PrintStream out)
out - an output stream.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||