Class com.tdac.mail.SocketConnection
All Packages Class Hierarchy This Package Previous Next Index
Class com.tdac.mail.SocketConnection
java.lang.Object
|
+----com.tdac.mail.SocketConnection
- public class SocketConnection
- extends Object
This base class defines a socket connection to a server.
- Version:
- 1.0, 11/11/96
- Author:
- Timothy D. A. Cox
-
SocketConnection()
- Construct an SocketConnection object.
-
connect(String, int, boolean)
- Connect to a server on a port.
-
disconnect()
- Disconnect the socket from the server
-
finalize()
- Finalize the connection.
-
read()
- Test routine used to read a single line from the server
-
readLine(boolean)
-
-
send(String)
- Test routine used to send a string to the server
-
writeLine(String)
-
SocketConnection
public SocketConnection()
- Construct an SocketConnection object.
finalize
public void finalize()
- Finalize the connection. This will invoke the 'disconnect'
method if the connection is still alive.
- Overrides:
- finalize in class Object
connect
public synchronized String connect(String server,
int port,
boolean greeting) throws ExceptionMailConnection
- Connect to a server on a port. Will setup the private
stream objects and optionally read the mail server greeting.
- Parameters:
- server - the mail server name (eg. mail.domain.com)
- port - the socket port to connect on (eg. 110 or 143)
- Returns:
- the mail server greeting string
disconnect
public void disconnect() throws ExceptionMailConnection
- Disconnect the socket from the server
readLine
public String readLine(boolean block) throws IOException
writeLine
public String writeLine(String io) throws IOException
send
public void send(String s) throws ExceptionMailConnection
- Test routine used to send a string to the server
- Parameters:
- s - the string command to be written
read
public String read() throws ExceptionMailConnection
- Test routine used to read a single line from the server
- Returns:
- single line server response
All Packages Class Hierarchy This Package Previous Next Index