Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jnats should use non-blocking NIO2 Sockets instead of legacy blocking IO. #347

Closed
jameshilliard opened this issue Oct 11, 2020 · 1 comment

Comments

@jameshilliard
Copy link
Contributor

Currently it appears Jnats is using legacy blocking socket streams for the SocketDataPort implementation, this should probably be migrated to use a non-blocking NIO2 AsynchronousSocketChannel for improved performance/latency along with thread safety. I'll probably try and do this myself once #346 is merged.

private Socket socket;
private SSLSocket sslSocket;
private InputStream in;
private OutputStream out;

Is there any reason that Jnats has avoided using NIO2 sockets that I should be aware of? From my initial reading of the code converting to NIO2 sockets should be fairly straight forward as Jnats seems to use the NIO based ByteBuffer's already for messages which is the same buffer format NIO2 based sockets expect for reading/writing.

@brimworks
Copy link
Collaborator

Track this need here: #317

Basically, we all want an async client, so let's track that need in the above issue.

Thanks!

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

No branches or pull requests

2 participants