Known Direct Subclasses
|
Known Indirect Subclasses
FtpClient |
This class implements the FTP client. |
SmtpClient |
This class implements the SMTP client. |
|
Class Overview
This is the base class for network clients.
Summary
Protected Methods |
Socket
|
createSocket()
The following method, createSocket, is provided to allow the
https client to override it so that it may use its socket factory
to create the socket.
|
Socket
|
doConnect(String server, int port)
Return a socket connected to the server, with any
appropriate options pre-established
|
InetAddress
|
getLocalAddress()
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Fields
protected
int
connectTimeout
protected
static
int
defaultConnectTimeout
protected
static
int
defaultSoTimeout
protected
static
String
encoding
protected
int
readTimeout
Buffered stream for reading replies from server.
Stream for printing to the server.
protected
Socket
serverSocket
Socket for communicating with server.
Public Constructors
public
NetworkClient
(String host, int port)
Create connection with host host on port port
Public Methods
public
void
closeServer
()
Close an open connection to the server.
public
int
getConnectTimeout
()
public
int
getReadTimeout
()
public
void
openServer
(String server, int port)
Open a connection to the server.
public
boolean
serverIsOpen
()
Return server connection status
public
void
setConnectTimeout
(int timeout)
public
void
setReadTimeout
(int timeout)
Protected Methods
protected
Socket
createSocket
()
The following method, createSocket, is provided to allow the
https client to override it so that it may use its socket factory
to create the socket.
protected
Socket
doConnect
(String server, int port)
Return a socket connected to the server, with any
appropriate options pre-established