Giter VIP home page Giter VIP logo

MIT License Build project Coverage Status

Introduction

The Simple Network Framework for Java (SNF4J) is an asynchronous event-driven network application framework for quick and easy development of network applications.

The SNF4J serves as a simple, lightweight and independent network application framework helping in developing high performance and scalable network applications. It provides an asynchronous API via the Java NIO to handle various transports like TCP/IP, UDP/IP and SCTP/IP.

The framework is designed to be simple in use and moderately easy to understand. Application developers that like to keep their ear to the ground will not be overwhelmed by a tone of source code. It is oriented towards delivering core networking functionality as transferring data between two or more communicating network applications in a simple but effective way. To provide privacy and integrity of transferred data it provides support for the SSL/TLS/DTLS protocols.

Design

  • Unified API for transport layer types: TCP, UDP and SCTP
  • Event-driven API for developing asynchronous network applications
  • Customizable protocol engines for transport layer types: TCP and UDP
  • Utilities for development of UDP server applications
  • Simple API for customizable encoder-decoder pipelines
  • Provide ease of programing multi-thread applications in a single-thread way
  • Building pipelines of sessions sharing the same socket channel

Performance and Scalability

  • Support for minimized or even zero unnecessary memory copying
  • Support for low memory utilization in multi-session applications
  • Lower latency
  • zlib and gzip compression
  • Customizable selector loop pooling
  • Customizable byte buffer allocators

Thread model

  • All handler's events (i.e. read, event, timer, exception, incident) are fired from the thread that performs I/O for the channel (I/O thread)
  • All session's methods are thread-safe and can be called from any thread including the I/O thread and non-I/O threads
  • Any handler's event triggered as a side effect of calling a session's method are fired from the I/O thread
  • Codec's code is always processed in the I/O thread
  • Engine's code is always processed in the I/O thread

Supported Protocols

  • HTTP Web Proxy Connect Protocol
  • SOCKS Protocols
  • WebSocket Protocol
  • Toolkit for TLS 1.3 Protocol (parsers/formatters, handshake engine, record layer utils and complete TLS engine)

Security

  • Complete support for SSL/TLS/DTLS protocols
  • Secure Web Proxy Connect

Integration

  • No additional dependencies, JDK 8 or JDK 9 (for DTLS) is enough
  • Fully customizable logging (SLF4J, Log4j 2 already here)
  • Customizable thread factories
  • Customizable session timers
  • Customizable packet retransmission models during DTLS handshakes

Compiling

You need Apache maven 3.8 or above , Java 8 or above

mvn install

Links

snf4j.org's Projects

snf4j icon snf4j

Simple Network Framework for Java - an asynchronous event-driven network application framework for quick and easy development of network applications.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.