It's a net library written in go applying the reactor pattern which is inspired by gnet. Certainly gknet benifts a lot from gnet, but it also brings something new.
go get -u github.com/moqsien/gknet@latestexamples
License
panjf2000
Actually gnet is a very excellent net library written in go. But the main cause for creating gknet is that I found it is really hard to implement a graceful-rebooting functionality for gnet apps. A special non-importable listener is applied by gnet, but there is no adapter for a Listener from the standard library. It seems that the only way to achieve graceful-rebooting is the unsafe pointer trick, or we just have to create a issue or pull request under gnet project.
However, I also noticed that gnet itself does not support http and TLS, and the author Andy Pan has no plan to implement TLS or importable listener support recently. Besides, the code design for gnet becomes somehow redundant recently. Therefore, gknet is created taking advantage of gnet's well-designed part, like buffers in user space, lock-free queues, etc.
Gknet tries to keep code from redundancy, adapt Listener from the standard library, and also provie builtin http as well as TLS support. More optimizations and functionalities are on the way: