Search in sources :

Example 1 with SecureSocketChannel

use of com.questdb.net.SecureSocketChannel in project questdb by bluestreak01.

the class JournalClient method openChannel.

private void openChannel() throws JournalNetworkException {
    if (this.channel == null || !this.channel.isOpen()) {
        SocketChannel channel = config.openSocketChannel();
        try {
            statsChannel = new StatsCollectingReadableByteChannel(channel.getRemoteAddress());
        } catch (IOException e) {
            throw new JournalNetworkException("Cannot get remote address", e);
        }
        SslConfig sslConfig = config.getSslConfig();
        if (sslConfig.isSecure()) {
            this.channel = new SecureSocketChannel(channel, sslConfig);
        } else {
            this.channel = channel;
        }
    }
}
Also used : SocketChannel(java.nio.channels.SocketChannel) SecureSocketChannel(com.questdb.net.SecureSocketChannel) SslConfig(com.questdb.net.SslConfig) JournalNetworkException(com.questdb.std.ex.JournalNetworkException) SecureSocketChannel(com.questdb.net.SecureSocketChannel) IOException(java.io.IOException) StatsCollectingReadableByteChannel(com.questdb.net.StatsCollectingReadableByteChannel)

Aggregations

SecureSocketChannel (com.questdb.net.SecureSocketChannel)1 SslConfig (com.questdb.net.SslConfig)1 StatsCollectingReadableByteChannel (com.questdb.net.StatsCollectingReadableByteChannel)1 JournalNetworkException (com.questdb.std.ex.JournalNetworkException)1 IOException (java.io.IOException)1 SocketChannel (java.nio.channels.SocketChannel)1