High-performance, event-driven/reactive network stack for Java 11+
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
Robinson 389be7b6db
added equals/hashCode
4 weeks ago
gradle/wrapper updated gradle 3 months ago
ignored_for_now/discovery More work done on cleaning up stack traces 3 years ago
not-fixed Removed coroutines from parts of the networking message processing. 8 months ago
src added equals/hashCode 4 weeks ago
test/dorkboxTest/network Fixed casting issues 1 month ago
.gitignore Updated to use Gradle Utils for gradle/project update management 4 years ago
LICENSE Updated build deps and license 1 month ago
LICENSE.Apachev2 Added license info. 7 years ago
LICENSE.BSD2 Converted to gradle 5 years ago
LICENSE.BSD3 Added license info. 7 years ago
LICENSE.CC0 Added more license files 3 years ago
LICENSE.MIT Added license info. 7 years ago
README.md updated version 1 month ago
build.gradle.kts updated version 1 month ago
gradle.properties Updated dependencies. 1 year ago
gradlew updated gradle 3 months ago
gradlew.bat updated gradle 3 months ago
logback.xml Cleaned up log messages, cleaned up handshakes, cleaned up polling code. Added unit test for concurrent client connections 10 months ago
settings.gradle.kts No longer depend on Utilities project, but on it's compiled sources. 4 years ago
storage.db Removed coroutines from parts of the networking message processing. 8 months ago

README.md

Network

Dorkbox Github Gitlab Bitbucket

The Network project is an encrypted, high-performance, event-driven/reactive Network stack with DNS and RMI, using Netty, Kryo, KryoNet RMI, and LZ4 via TCP/UDP.

These are the main features:

  • The connection between endpoints is AES256-GCM / EC curve25519. (WIP, this was updated for use with Aeron, which changes this)
  • The connection data is LZ4 compressed and byte-packed for small payload sizes. (WIP, this was updated for use with Aeron, which changes this)
  • The connection supports:

  • Remote Method Invocation

    • Blocking
    • Non-Blocking
    • Void returns
    • Exceptions can be returned
    • Kotlin coroutine suspend functions
  • Sending data when Idle

  • "Pinging" the remote end (for measuring round-trip time)

  • Firewall connections by IP+CIDR

  • Specify the connection type (nothing, compress, compress+encrypt)

  • The available transports are TCP and UDP

  • There are simple wrapper classes for:

    • Server
    • Client
    • MultiCast Broadcast client and server discovery (WIP, this was updated for use with Aeron, which changes this)
  • Note: There is a maximum packet size for UDP, 508 bytes to guarantee it's unfragmented

  • This is for cross-platform use, specifically - linux 32/64, mac 64, and windows 32/64. Java 1.8+

public static
class AMessage {
    public
    AMessage() {
    }
}

KryoCryptoSerializationManager.DEFAULT.register(AMessage.class);

Configuration configuration = new Configuration();
configuration.tcpPort = tcpPort;
configuration.host = host;

final Server server = new Server(configuration);
addEndPoint(server);
server.bind(false);

server.listeners()
      .add(new Listener<AMessage>() {
          @Override
          public
          void received(Connection connection, AMessage object) {
              System.err.println("Server received message from client. Bouncing back.");
              connection.send()
                        .TCP(object);
          }
      });

Client client = new Client(configuration);
client.disableRemoteKeyValidation();
addEndPoint(client);
client.connect(5000);

client.listeners()
      .add(new Listener<AMessage>() {
          @Override
          public
          void received(Connection connection, AMessage object) {
              ClientSendTest.this.checkPassed.set(true);
              System.err.println("Tada! It's been bounced back.");
              server.stop();
          }
      });

client.send()
      .TCP(new AMessage());

   

Maven Info

<dependencies>
    ...
    <dependency>
      <groupId>com.dorkbox</groupId>
      <artifactId>Network</artifactId>
      <version>6.4</version>
    </dependency>
</dependencies>

Gradle Info

dependencies {
    ...
    implementation("com.dorkbox:Network:6.4")
}

License

This project is © 2021 dorkbox llc, and is distributed under the terms of the Apache v2.0 License. See file "LICENSE" for further references.