public void exceptionOccurred(Throwable t) {
LogManager.log(t instanceof IOException?MessageLevel.DETAIL:MessageLevel.ERROR, LogConstants.CTX_TRANSPORT, t, "Unhandled exception, closing client instance"); //$NON-NLS-1$
}
public void onConnection() throws CommunicationException {
Handshake handshake = new Handshake();
if (usingEncryption) {
keyGen = new DhKeyGenerator();
byte[] publicKey;
try {
publicKey = keyGen.createPublicKey();
} catch (CryptoException e) {
throw new CommunicationException(e);
}
handshake.setPublicKey(publicKey);
}
this.objectSocket.write(handshake);
}