| com.coldcore.coloradoftp.connection.Connection
All known Subclasses: com.coldcore.coloradoftp.connection.impl.GenericConnection,
Connection | public interface Connection (Code) | | Data or control connection.
Connections read and write data from and to users.
Life cycle of a connection is very simple. When it is accepted and configured it is then
added to a connection pool which calls on it service method. When connection dies, the
connection pool removes it from its internal list and the connection will be garbage
collected.
When poisoned, connection must die as soon as it has nothing to read/write to/from user.
This is mainly for control connections as data connections do not use it. But since
connection pool's specification requires it to poison all connections as soon as server's
core becomes poisoned (before shutdown to let everyone finish and leave), the methods are
located in this class.
ColoradoFTP - The Open Source FTP Server (http://cftp.coldcore.com)
|
destroy | public void destroy()(Code) | | Kill connection (free resources)
|
getBytesRead | public long getBytesRead()(Code) | | Get bytes user sent so far
Bytes count |
getBytesWrote | public long getBytesWrote()(Code) | | Get bytes server sent so far
Bytes count |
initialize | public void initialize(SocketChannel channel)(Code) | | Initialize connection (acquire resources)
Parameters: channel - Channel |
isDestroyed | public boolean isDestroyed()(Code) | | Test if connection is destroyed
TRUE if destroyed, FALSE otherwise |
isPoisoned | public boolean isPoisoned()(Code) | | Test if connection is poisoned (will be destroyed shortly)
TRUE if poisoned, FALSE otherwise |
poison | public void poison()(Code) | | Poison connection (when there is nothing more to read/write it must die,
data connections output/input data and die, control connections are not allowed to
read user input and die when all output is done)
|
|
|