Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-24.04, macOS-15, macOS-15-intel, windows-2022]
os: [ubuntu-24.04, ubuntu-24.04-arm, macOS-15, macOS-15-intel, windows-2022]
java: ['17', '21', '25']
distribution: ['temurin']
gradle: ['8.14.4', '9.2.1']
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-24.04, macOS-15]
os: [ubuntu-24.04, ubuntu-24.04-arm, macOS-15]
java: [ '25' ]
distribution: [ 'graalvm-community' ]
gradle: ['9.2.1']
Expand Down
17 changes: 12 additions & 5 deletions core/src/main/java/org/bitcoinj/net/NioServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ private void handleKey(Selector selector, SelectionKey key) throws IOException {
if (key.isValid() && key.isAcceptable()) {
// Accept a new connection, give it a stream connection as an attachment
SocketChannel newChannel = sc.accept();
if (newChannel == null)
return; // Spurious wakeup, no pending connection
newChannel.configureBlocking(false);
SelectionKey newKey = newChannel.register(selector, SelectionKey.OP_READ);
try {
Expand Down Expand Up @@ -82,10 +84,15 @@ public NioServer(final StreamConnectionFactory connectionFactory, InetSocketAddr
this.connectionFactory = connectionFactory;

sc = ServerSocketChannel.open();
sc.configureBlocking(false);
sc.socket().bind(bindAddress);
selector = SelectorProvider.provider().openSelector();
sc.register(selector, SelectionKey.OP_ACCEPT);
try {
sc.configureBlocking(false);
sc.socket().bind(bindAddress);
selector = SelectorProvider.provider().openSelector();
sc.register(selector, SelectionKey.OP_ACCEPT);
} catch (IOException e) {
sc.close();
throw e;
}
}

@Override
Expand All @@ -102,7 +109,7 @@ protected void run() {
handleKey(selector, key);
}
}
} catch (IOException e) {
} catch (Exception e) {
log.error("Error trying to open/read from connection", e);
} finally {
// Go through and close everything, without letting IOExceptions get in our way
Expand Down
2 changes: 1 addition & 1 deletion wallettemplate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ configurations.configureEach {
}

javafx {
version = '25.0.1'
version = '25.0.2'
modules = [ 'javafx.controls', 'javafx.fxml' ]
}

Expand Down
Loading