org.objectweb.jonathan.protocols.ip.api
Interface IpConnection
- JConnectionMgr.Connection
public interface IpConnection
A IpConnection represents a communication resource. It encapsulates a socket.
A connection may always be related to a given session, i.e., a communication
channel.
available
public int available()
throws IOException
delete
public void delete()
Deletes this connection, removing it from the connection manager, and
closing the socket. This method should not be used a a socket user unless
a problem occurs on the connection, like an exception when trying to read
or to write data.
emit
public void emit(Chunk chunk)
throws IOException
getHostName
public String getHostName()
Returns the host name of the underlying socket.
- the host name of the underlying socket.
getPort
public int getPort()
Returns the port number of the underlying socket.
- the port number of the underlying socket.
getSession
public IpSession getSession()
Returns the session attached to this connection.
- the session attached to this connection.
receive
public void receive(Chunk chunk,
int sz)
throws IOException
release
public void release()
Releases this connection. This is to indicate to the connection manager that
this connection is no longer used.
setSession
public void setSession(IpSession session)
Attaches a new session to this connection.
session
- the session to be attached to the target connection.