pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: davecramer (@davecramer) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] PR #4073: Nio selector
Date: Fri, 15 May 2026 11:18:51 +0000
Message-ID: <[email protected]> (raw)

Create connections using SocketChannel.open() instead of plain Socket
  when the default socket factory is used. This provides a Selector that
  can check socket readability without consuming data — enabling safe
  background notification polling in a future commit.
  
  - SocketChannel created in createSocket(), kept in blocking mode for
    normal I/O compatibility
  - Selector opened alongside the channel
  - isDataAvailable(timeoutMillis) uses selector.select() to check for
    incoming data without reading bytes — safe for background threads
  - hasSelector() indicates NIO availability
  - changeSocket() (SSL upgrade) invalidates channel/selector since SSL
    wraps the socket with a different stream
  - Selector closed in PGStream.close()
  
  Non-SSL connections get full Selector support. SSL connections fall back
  to the existing hasMessagePending() polling approach."

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] PR #4073: Nio selector
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox