Network Application Framework
NAF is an open-source Java API that implements an event-driven framework based on the JDK's NIO interface for non-blocking sockets.
Key features of NAF:
NAF supports non-blocking I/O operations and timers, enabling you to scale to extremely large numbers of concurrent connections and high data throughput levels.
NAF provides a lock-free single-threaded execution environment based on the Reactor pattern - parallelism can be provided by adding more Dispatcher threads.
NAF provides seamless support for non-blocking I/O on SSL connections as well.
You can easily create client or server SSL connections, with or without client certificates, and you can start the connection in SSL mode, or negotiate the transition to SSL later.
You can set up your application in an entirely programmatic manner if you wish, but it can also be automatically constructed and launched via an XML config file, in which you specify the application classes to be instantiated.
NAF contains a built-in management agent (NAFMAN) that offers an extensible web-based GUI. This lets you see snapshots of the registered I/O endpoints and timers in real time and you can even kill individual connections.
NAF contains a non-blocking asynchronous DNS-Resolver API, allowing you to query for NS, MX, SOA, SRV and TXT records as well as the usual A (hostname-to-IP) and PTR (IP-to-hostname) lookups.
NAF also contains a blocking DNS-Resolver API which provides simple access to all the above, for non-NAF applications, ie. applications that are not necessarily built to run within the NAF framework, but simply require a utility API.
NAF encourages object reuse and minimises memory churn (ie. garbage generation), thus minimising the need for expensive GC (Garbage Collector) runs.
Along the same lines, it provides Maps and Sets for primitive integers, avoiding the penalty of autoboxing.
NAF provides a simple API to common SASL authentication mechanisms - Plain, CRAM-MD5, External
|NAFMAN Start screen
||Dispatcher Details screen
The Programmer's Guide and API Reference are included in the download, but can also be viewed online:
• Programmer's Guide
• API Reference
NAF is open source software, distributed under the terms of the
GNU Affero General Public License, version 3 (AGPLv3).
NAF is used as the basis for the high-performance mail server,
NAF releases are available in source form, or as pre-compiled JARs, and can be downloaded
The NAF Source is also hosted on GitHub, at
More recent pre-releases snapshots are sometimes available here.
NB: Requires Java 7 or later.
Please contact firstname.lastname@example.org for more information.