Skip to content

HTTPCORE-798: Make socket channel creation customizable - #690

Merged
arturobernalg merged 1 commit into
apache:masterfrom
arturobernalg:HTTPCORE-798
Aug 24, 2026
Merged

HTTPCORE-798: Make socket channel creation customizable#690
arturobernalg merged 1 commit into
apache:masterfrom
arturobernalg:HTTPCORE-798

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Add a socket channel factory extension point to the connecting I/O reactor.

* @since 5.5
*/
@FunctionalInterface
public interface SocketChannelFactory {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg Can't we reuse already existing IOFunction interface here instead of this one?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg Can't we reuse already existing IOFunction interface here instead of this one?

@ok2c Good point, I’ll reuse it and remove SocketChannelFactory.

try {
socketChannel = openSocketFor(sessionRequest.remoteAddress);
} catch (final IOException ex) {
socketChannel = Args.notNull(socketChannelFactory.apply(sessionRequest.remoteAddress), "Socket channel");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg This looks odd. Why Args#notNull here? It is not an argument and it is never null

Add a socket channel factory extension point to the connecting I/O reactor.
@arturobernalg
arturobernalg merged commit 52e323c into apache:master Aug 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants