public abstract Connection connection();
public Connection endpoint(Sender<ByteBuffer> sender)
{
Connection conn = connection();
if (conn.getConnectionSettings() != null &&
conn.getConnectionSettings().isUseSASLEncryption())
{
sender = new SASLSender(sender);
conn.addConnectionListener((ConnectionListener)sender);
}
// XXX: hardcoded max-frame
Disassembler dis = new Disassembler(sender, MAX_FRAME_SIZE);
conn.setSender(dis);
return conn;
}