de.trantor.mail.j2se
Class ConnectionImpl

java.lang.Object
  |
  +--de.trantor.mail.Connection
        |
        +--de.trantor.mail.j2se.ConnectionImpl

public class ConnectionImpl
extends Connection

Provides a concrete descendent of the abstract "Connection" class that can be used in the J2SE environment. It is based on java.net.Socket.

See Also:
Connection, Socket

Constructor Summary
ConnectionImpl()
           
 
Method Summary
 void close()
          Closes the connection.
 boolean connected()
          Queries the current status of the connection.
 void open(java.lang.String host, int port, boolean ssl)
          Opens a connection with the given host on the given port.
protected  int read(byte[] buffer, int offset, int count)
          Reads from the socket.
protected  void write(byte[] buffer, int offset, int count)
          Writes to the socket.
 
Methods inherited from class de.trantor.mail.Connection
getDebug, getInstance, receive, send, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionImpl

public ConnectionImpl()
Method Detail

open

public void open(java.lang.String host,
                 int port,
                 boolean ssl)
          throws java.io.IOException
Opens a connection with the given host on the given port.

Specified by:
open in class Connection
java.io.IOException
See Also:
close()

close

public void close()
           throws java.io.IOException
Closes the connection.

Specified by:
close in class Connection
java.io.IOException
See Also:
open(java.lang.String, int, boolean)

read

protected int read(byte[] buffer,
                   int offset,
                   int count)
            throws java.io.IOException
Description copied from class: Connection
Reads from the socket.

Specified by:
read in class Connection
java.io.IOException

write

protected void write(byte[] buffer,
                     int offset,
                     int count)
              throws java.io.IOException
Description copied from class: Connection
Writes to the socket.

Specified by:
write in class Connection
java.io.IOException

connected

public boolean connected()
Description copied from class: Connection
Queries the current status of the connection.

Specified by:
connected in class Connection