Giter Club home page Giter Club logo

java-nio's Introduction

java-nio

Follow the link to find Presentation

Follow the link to find Javeloper Presentation

There are 3 examples using Java Nio library:

1. Simple Echo server implementation app/src/main/java/com/nio/EchoServer.java

  1. Build project using gradle clean && gradle build
  2. Run the server using java -cp . app/src/main/java/com/nio/EchoServer.java
  3. Connect to the server using nc -v 0.0.0.0 5555

2. Tcp server implementation of Reactor pattern app/src/main/java/com/nio/reactor/TcpServer.java

  1. Build project using gradle clean && gradle build
  2. Run the server using java -cp . app/src/main/java/com/nio/reactor/TcpServer.java
  3. Connect to the server using nc -v 0.0.0.0 5555

3. Tcp server implementation provided Data Flow Control app/src/main/java/com/nio/TcpDataFlowExample.java

  1. Build project using gradle clean && gradle build
  2. Run the server using java -cp . app/src/main/java/com/nio/TcpDataFlowExample.java
  3. Connect to the data channel nc -v 0.0.0.0 5555
  4. Connect to the control channel nc -v 0.0.0.0 4444

The idea of the project to show how we can manipulate with TCP Flow Control using Java Nio. There data and control channels. The data channel receive inbound data and convert it to UPPERCASE (just for fun). The control channel has 2 commands stop-read and start-read data to manipulate with data in the data channel. When we send stop-read command to the control channel the data channel will stop receive inbound data. In such case we can get TCP Window Size to 0. To start read data again we need to send start-read command and after that all data are contained to the queue will be received by the data channel.

To send huge amount of data you can generate it here https://json-generator.com

References

Basic

  1. ITT 2015 - Heinz Kabutz - The Multi-threading, Non Blocking IO
  2. Java NIO Tutorial
  3. Scalable IO in Java

Advanced

  1. Queueing in the Linux Network Stack
  2. Multi-queue improvements in Linux kernel Ethernet driver mvneta
  3. TCP/IP Illustrated, Volume 1: The Protocols, 2nd Edition
  4. Java NIO - Reactor
  5. SSL Introduction with Sample Transaction and Packet Exchange
  6. Java SSLEngine
  7. Performance and scalability analysis of Java IO and NIO based server models, their implementation and comparison

java-nio's People

Contributors

dshcherbatiuk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.