|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsun.net.NetworkClient
public class NetworkClient
This is the base class for network clients.
| Field Summary | |
|---|---|
protected static int |
defaultConnectTimeout
|
protected static int |
defaultSoTimeout
|
protected static String |
encoding
|
InputStream |
serverInput
Buffered stream for reading replies from server. |
PrintStream |
serverOutput
Stream for printing to the server. |
protected Socket |
serverSocket
Socket for communicating with server. |
| Constructor Summary | |
|---|---|
NetworkClient()
|
|
NetworkClient(String host,
int port)
Create connection with host host on port port |
|
| Method Summary | |
|---|---|
void |
closeServer()
Close an open connection to the server. |
protected Socket |
doConnect(String server,
int port)
Return a socket connected to the server, with any appropriate options pre-established |
protected InetAddress |
getLocalAddress()
|
void |
openServer(String server,
int port)
Open a connection to the server. |
boolean |
serverIsOpen()
Return server connection status |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Socket serverSocket
public PrintStream serverOutput
public InputStream serverInput
protected static int defaultSoTimeout
protected static int defaultConnectTimeout
protected static String encoding
| Constructor Detail |
|---|
public NetworkClient(String host,
int port)
throws IOException
IOExceptionpublic NetworkClient()
| Method Detail |
|---|
public void openServer(String server,
int port)
throws IOException,
UnknownHostException
IOException
UnknownHostException
protected Socket doConnect(String server,
int port)
throws IOException,
UnknownHostException
IOException
UnknownHostException
protected InetAddress getLocalAddress()
throws IOException
IOException
public void closeServer()
throws IOException
IOExceptionpublic boolean serverIsOpen()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||