Network/README.md

93 lines
2.6 KiB
Markdown
Raw Normal View History

2021-08-23 09:08:18 +02:00
Network
=======
2023-06-26 02:22:46 +02: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)
2021-08-23 09:08:18 +02:00
2023-06-26 02:22:46 +02:00
The Network project is an ~~encrypted~~, high-performance, event-driven/reactive Network stack with DNS and RMI, using Aeron, Kryo, KryoNet RMI, ~~encryption and LZ4 via UDP.~~
2021-08-23 09:08:18 +02:00
These are the main features:
2023-06-26 02:22:46 +02:00
~~* 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:
- Sending object (via the Kryo serialization framework)
- Sending arbitrarily large objects
2021-08-23 09:08:18 +02:00
- Remote Method Invocation
- Blocking
- Non-Blocking
- Void returns
- Exceptions can be returned
2022-03-29 00:40:18 +02:00
- Kotlin coroutine suspend functions
2023-06-26 02:22:46 +02:00
- ~~Sending data when Idle~~
2021-08-23 09:08:18 +02:00
- "Pinging" the remote end (for measuring round-trip time)
- Firewall connections by IP+CIDR
2023-06-26 02:22:46 +02:00
- ~~Specify the connection type (nothing, compress, compress+encrypt)~~
2021-08-23 09:08:18 +02:00
2023-06-26 02:22:46 +02:00
- The available transports is UDP
2021-08-23 09:08:18 +02:00
2023-06-26 02:22:46 +02:00
- This is for cross-platform use, specifically - linux 32/64, mac 64, and windows 32/64. Java 1.11+
- This library is designed to be used with kotlin, specifically the use of coroutines.
2021-08-23 09:08:18 +02:00
``` java
2023-06-26 02:22:46 +02:00
val configurationServer = ServerConfiguration()
configurationServer.settingsStore = Storage.Memory() // don't want to persist anything on disk!
configurationServer.port = 2000
configurationServer.enableIPv4 = true
val server: Server<Connection> = Server(configurationServer)
server.onMessage<String> { message ->
logger.error("Received message '$message'")
2021-08-23 09:08:18 +02:00
}
2023-06-26 02:22:46 +02:00
server.bind()
val configurationClient = ClientConfiguration()
configurationClient.settingsStore = Storage.Memory() // don't want to persist anything on disk!
configurationClient.port = 2000
val client: Client<Connection> = Client(configurationClient)
client.onConnect {
send("client test message")
}
client.connect()
2021-08-23 09:08:18 +02:00
```
2023-06-26 02:22:46 +02:00
2021-08-23 09:08:18 +02:00
&nbsp;
&nbsp;
Maven Info
---------
```
<dependencies>
...
<dependency>
<groupId>com.dorkbox</groupId>
<artifactId>Network</artifactId>
2023-09-07 18:15:20 +02:00
<version>6.10</version>
2021-08-23 09:08:18 +02:00
</dependency>
</dependencies>
```
Gradle Info
---------
```
dependencies {
...
2023-09-07 18:15:20 +02:00
implementation("com.dorkbox:Network:6.10")
2021-08-23 09:08:18 +02:00
}
```
License
---------
2023-06-26 02:22:46 +02:00
This project is © 2023 dorkbox llc, and is distributed under the terms of the Apache v2.0 License. See file "LICENSE" for further
2021-08-23 09:08:18 +02:00
references.