Network/README.md

142 lines
4.4 KiB
Markdown
Raw Normal View History

2016-03-11 03:55:43 +01:00
Network
=======
2019-03-17 16:45:10 +01:00
###### [![Dorkbox](https://badge.dorkbox.com/dorkbox.svg "Dorkbox")](https://git.dorkbox.com/dorkbox/Network) [![Github](https://badge.dorkbox.com/github.svg "Github")](https://github.com/dorkbox/Network) [![Gitlab](https://badge.dorkbox.com/gitlab.svg "Gitlab")](https://gitlab.com/dorkbox/Network) [![Bitbucket](https://badge.dorkbox.com/bitbucket.svg "Bitbucket")](https://bitbucket.org/dorkbox/Network)
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.
2016-03-11 03:55:43 +01:00
These are the main features:
- The connection between endpoints is AES256-GCM / EC curve25519.
- The connection data is LZ4 compressed and byte-packed for small payload sizes.
- The connection supports:
- Remote Method Invocation
- Blocking
- Non-Blocking
- Void returns
- Exceptions can be returned
- Sending data when Idle
- "Pinging" the remote end (for measuring round-trip time)
- The available transports are TCP and UDP
2016-03-11 03:55:43 +01:00
- There are simple wrapper classes for:
- Server
- Client
- DNS Client (for querying DNS servers)
- MultiCast Broadcast client and server discovery
- Note: There is a maximum packet size for UDP, 508 bytes *to guarantee it's unfragmented*
2016-03-11 03:55:43 +01:00
2019-03-17 21:16:59 +01:00
- This is for cross-platform use, specifically - linux 32/64, mac 64, and windows 32/64. Java 8+
2016-03-11 03:55:43 +01:00
``` java
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());
```
2017-02-18 23:59:18 +01:00
&nbsp;
&nbsp;
2016-03-11 03:55:43 +01:00
2017-02-18 23:59:18 +01:00
Release Notes
---------
2016-03-11 03:55:43 +01:00
2017-02-18 23:59:18 +01:00
This project includes some utility classes that are a small subset of a much larger library. These classes are **kept in sync** with the main utilities library, so "jar hell" is not an issue, and the latest release will always include the same version of utility files as all of the other projects in the dorkbox repository at that time.
2018-08-18 23:15:46 +02:00
Please note that the utility source code is included in the release and on our [Git Server](https://git.dorkbox.com/dorkbox/Utilities) repository.
2017-02-01 00:53:22 +01:00
2017-02-18 23:59:18 +01:00
Maven Info
---------
2016-03-11 03:55:43 +01:00
```
<dependencies>
...
<dependency>
<groupId>com.dorkbox</groupId>
<artifactId>Network</artifactId>
2018-04-05 18:39:45 +02:00
<version>2.11</version>
</dependency>
</dependencies>
2016-03-11 03:55:43 +01:00
```
2018-08-18 23:15:46 +02:00
Gradle Info
---------
````
dependencies {
...
compile 'com.dorkbox:Network:2.11'
}
````
2016-03-11 03:55:43 +01:00
Or if you don't want to use Maven, you can access the files directly here:
2018-08-18 23:15:46 +02:00
https://repo1.maven.org/maven2/com/dorkbox/Network/
2016-03-11 03:55:43 +01:00
2018-08-18 23:15:46 +02:00
https://repo1.maven.org/maven2/releases/com/dorkbox/ObjectPool/
https://repo1.maven.org/maven2/com/dorkbox/MinLog-SLF4J/
2016-03-12 12:52:27 +01:00
2016-03-11 03:55:43 +01:00
https://repo1.maven.org/maven2/org/slf4j/slf4j-api/
https://repo1.maven.org/maven2/io/netty/netty-all/ (latest 4.1)
https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/
https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/
https://repo1.maven.org/maven2/asm/asm/
https://repo1.maven.org/maven2/org/javassist/javassist/
https://repo1.maven.org/maven2/com/esotericsoftware/jsonbeans/
https://repo1.maven.org/maven2/com/esotericsoftware/reflectasm/
https://repo1.maven.org/maven2/net/jpountz/lz4/lz4/
https://repo1.maven.org/maven2/org/objenesis/objenesis/
https://repo1.maven.org/maven2/com/esotericsoftware/kryo/
2017-02-18 23:59:18 +01:00
License
---------
2016-04-05 14:47:40 +02:00
This project is © 2010 dorkbox llc, and is distributed under the terms of the Apache v2.0 License. See file "LICENSE" for further references.
2016-03-11 03:55:43 +01:00