public interface SshMessage
TransportProtocol#sendMessage(SshMessage)
with an implementation of
this interface. When the socket is ready for writing and your message is the
next available in the outgoing queue your implementation of
writeMessageIntoBuffer(ByteBuffer)
will be called. You should write
the SSH message into the ByteBuffer and return. When the message has been
written out to the socket messageSent()
will be called.sendMessage(new SshMessage() { public void writeMessageIntoBuffer(ByteBuffer buf) { buf.put((byte) TransportProtocol.SSH_MSG_NEWKEYS); } public void messageSent() { // Potentially we could generate the keys if we have received SSH_MSG_NEWKEYS synchronized (keyExchange) { if(log.isDebugEnabled()) log.debug("Sent SSH_MSG_NEWKEYS"); keyExchange.sentNewKeys = true; generateNewKeys(); } } });
For most server implementations it will not be required to implement this interface. It is essentially for internal use but may be used if you develop a custom authentication mechanism that requires additional messages to be sent to the client
Modifier and Type | Method and Description |
---|---|
void |
messageSent() |
void |
writeMessageIntoBuffer(ByteBuffer buf)
Write the SSH message data into a ByteBuffer.
|
void writeMessageIntoBuffer(ByteBuffer buf)
buf
- void messageSent()
Copyright © 2024. All rights reserved.