Skip to content

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

Open
arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:HTTPCORE-798
Open

HTTPCORE-798: Make socket channel creation customizable#690
arturobernalg wants to merge 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.

Add a socket channel factory extension point to the connecting I/O reactor.
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

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