-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ybadri
committed
Jul 11, 2018
1 parent
73d62d5
commit d246b31
Showing
207 changed files
with
6,771 additions
and
6,115 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
Network Application Framework (NAF) | ||
Copyright (C) 2010-2016 Yusef Badri <yb a.t greyware d.o.t co d.o.t uk> | ||
Copyright (C) 2010-2018 Yusef Badri <yb a.t greyware d.o.t co d.o.t uk> | ||
NAF is distributed under the terms of the GNU Affero General Public License, Version 3 (AGPLv3). | ||
|
||
This product contains static bindings to the SLF4J API, permitting the optional use of SLF4J logger plugins. | ||
Copyright (c) 2004-2011 QOS.ch | ||
SLF4J is distributed under an MIT/X11 licence. | ||
Copyright (c) 2004-2017 QOS.ch | ||
SLF4J is distributed under an MIT/X11 licence and is not included in this distribution. | ||
|
||
This product contains static bindings permitting the optional use of Apache Commons Logging (aka the JCL). | ||
Copyright 2003-2007 The Apache Software Foundation | ||
Apache Commons Logging is distributed under the Apache Licence v2.0 | ||
Copyright 2003-2016 The Apache Software Foundation | ||
Apache Commons Logging is distributed under the Apache Licence v2.0 and is not included in this distribution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
If you have downloaded the binary distribution, skip straight to Section B. | ||
|
||
If you simply want to link NAF into your application, the Maven dependency block is as follows: | ||
<dependency> | ||
<groupId>com.github.greysoft.naf</groupId> | ||
<artifactId>greynaf</artifactId> | ||
<version>2.5.0</version> | ||
</dependency> | ||
|
||
Section A - Building From Source | ||
================================= | ||
NAF (Network Application Framework) is an open-source framework for non-blocking sockets I/O and timers. | ||
The source code is available for download at: http://www.greyware.co.uk/naf | ||
|
||
Prerequisites: | ||
- You will need to have the Java JDK (Java 8 or later) on your Path | ||
- You will need to have the Maven build tool (3.5+) on your Path | ||
|
||
You can build the binary release from the source as follows: | ||
(we illustrate the procedure here with the Unix shell commands but the equivalent DOS commands should be obvious) | ||
|
||
1) Extract the source tarball to a directory which we'll call SRCROOT. | ||
Documentation is now available by pointing your browser at SRCROOT/docs/guide/index.htm | ||
|
||
2) Run these commands from Unix shell. | ||
- cd SRCROOT/ossnaf | ||
- mvn -Dgrey.logger.level=WARN clean install | ||
The system property setting shown is recommended to reduce the noise from the unit tests. | ||
|
||
That's it! The binary distributions will now be under SRCROOT/ossnaf/target, in both the ZIP and tar.gz formats | ||
This corresponds to the pre-built binary distribution you could have downloaded, so continue to the next step ... | ||
|
||
------------------------------------------------------------- | ||
|
||
Section B - Contents of Binary Distribution | ||
============================================ | ||
A binary release of NAF is available in both the ZIP format or as a compressed tar file. | ||
You "install" it simply by unpacking, and the extracted contents are: | ||
- ./lib: The NAF library JARs | ||
- ./samples: Pre-built binaries of the sample applications, along with | ||
suggested config files. | ||
- ./docs: Documentation, both a Programmer's Guide and a Javadoc-style | ||
API reference. | ||
- These text files (README and licencing info) | ||
|
||
From now on, we'll refer to this root directory of the installed binary release as NAFHOME. | ||
|
||
------------------------------------------------------------- | ||
|
||
Section C - Demo Apps | ||
====================== | ||
You will find the sample apps under NAFHOME/samples and the simplest way to run them is to copy their JARs into NAFHOME/lib and their config files to NAFHOME/conf. | ||
Then execute them from NAFHOME. | ||
|
||
Note that if there is already a NAF application running on the standard NAFMAN port of 13000, you can specify an alternative port on the JVM command line thus: | ||
-Dgreynaf.baseport=13100 | ||
|
||
The DNS Batch Resolver (which is technically a built-in NAFlet rather than a sample app) could be run by entering the following: | ||
java -jar lib/greynaf-2.5.0.jar -c conf/batchresolver.xml -logger dnsbatch < infile | ||
This would write the results to stdout and log messages to ./dnsbatchresolver.log | ||
See the NAF Programmer's Guide for more info about how to run the Batch Resolver. | ||
Note that the actual JAR filenames will obviously depend on the current version. | ||
|
||
The Port Forwarder sample app could be run as: | ||
java -jar lib/samples-portfwd-2.5.0.jar -c conf/portfwd.xml -logger portfwd & | ||
The logfile will be under ./var/logs | ||
|
||
The Echo Bot could run a simple TCP test like this: | ||
java -Dgreynaf.dispatchers.logname=echobot -jar lib/samples-echobot-2.5.0.jar -logger echobot -server-solo -clients 10:2 18001 | ||
Since this command creates multiple Dispatchers, which would normally use distinct loggers that are named after them, the above command sets a system property that directs them all to use the same GreyLog logger. | ||
|
||
All the above apps use GreyLog for their logging, and if you experience any issues with it, you can set the system property grey.logger.diagnostics=Y to get more information about what's going on. | ||
This can be done on the Java command-line, or put it in the grey.properties file, to avoid having to continually type it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- | ||
Copyright 2018 Yusef Badri - All rights reserved. | ||
NAF is distributed under the terms of the GNU Affero General Public License, Version 3 (AGPLv3). | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.github.greysoft.naf</groupId> | ||
<artifactId>ossnaf</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
<artifactId>greynaf-bom</artifactId> | ||
<packaging>pom</packaging> | ||
<name>NAF BOM</name> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>greybase</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>greynaf</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>greylog</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>greylog-slf4j</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
</project> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.