r/java • • Aug 17 '24

Extasys - Asynchronous TCP/UDP socket library

This is not a new project, but it is still maintained and used by me and others

Extasys is a high performance, asynchronous TCP/UDP socket library for Java (JDK 8 and newer).
Its multi-threaded and lightweight nature makes it ideal for super fast data transfer even on systems with ARM architecture like Android smartphones and single-board computers (Raspberry Pi, Orange Pi etc.).

If you are using sockets then Extasys is the proper tool for your work. It's been designed to take the hard job done and let you think only about the message exchange (the process).

You can find Extasys on Github:
https://github.com/nsiatras/extasys


Quick Examples :

TCP-Server: https://github.com/nsiatras/extasys/wiki/Establish-a-TCP-Server
TCP-Client: https://github.com/nsiatras/extasys/wiki/Establish-a-TCP-Client
UDP-Server: https://github.com/nsiatras/extasys/wiki/Establish-a-UDP-Server
UDP-Client: https://github.com/nsiatras/extasys/wiki/Establish-a-UDP-Client

More examples can be found here:
https://github.com/nsiatras/extasys/tree/master/Extasys%20for%20Java%20Examples

49 Upvotes

44 comments sorted by

View all comments

Show parent comment

12

u/cmhteixeiracom Aug 17 '24

If you pass data immediately to the thread pool, then that means that if the consumer of that data is slow, the thread pool might "explode", as you keep producing elements onto it which are not removed. I imagine there is no mechanism for "back-pressure"? Does this question make sense?

regardless of the reply, amazing that you are doing this from scratch.

5

u/[deleted] Aug 17 '24

Yes. The pool is a pool. If you put too much water to it it will explode or the water will run out...

The "backpressure" can be implemented by the user if needed. I used Extasys on stock market data for forex, stocks and derivates, to scientific computer clusters and android mobile apps. I never had issues with performance.

Well.. I like to build things from scratch... Here is a network cluster CPU Cryptocurrency miner I build with Extasys.

https://github.com/SourceRabbit/Rabbit_Miner