https://github.com/generaloss/network-forge
Network Library
https://github.com/generaloss/network-forge
Last synced: 5 months ago
JSON representation
Network Library
- Host: GitHub
- URL: https://github.com/generaloss/network-forge
- Owner: generaloss
- License: gpl-3.0
- Created: 2025-08-08T16:37:46.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-08-08T18:43:48.000Z (10 months ago)
- Last Synced: 2025-08-08T20:45:29.296Z (10 months ago)
- Language: Java
- Size: 27.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# [Network Forge](https://github.com/generaloss/network-forge)
[](https://mvnrepository.com/artifact/io.github.generaloss/network-forge)
A lightweight and flexible Java networking library for building custom networked applications.
It provides **packet-oriented TCP connections**, **fine-grained socket option control**, and **optional encryption** with JCE ciphers.
---
## Installation
Add the dependency from Maven Central:
``` xml
io.github.generaloss
network-forge
26.1.1
```
Requirements:
* Java 11 or higher
---
## Quick Start
### TCP Server
``` java
TCPServer server = new TCPServer();
server.registerOnConnect(connection -> {
connection.send("Hello, client!");
});
server.registerOnReceive((senderConnection, data) -> {
String received = new String(data);
System.out.println(received); // Output: Hello, server!
});
server.registerOnDisconnect((connection, reason, e) -> {
server.close(); // close server
});
server.run(5555);
```
### TCP Client
``` java
TCPClient client = new TCPClient();
client.registerOnReceive((connection, data) -> {
String received = new String(data);
System.out.println(received); // Output: Hello, client!
client.close(); // disconnect client
});
client.connect("localhost", 5555);
client.send("Hello, server!");
```
---
## Documentation
See the [**Wiki**](https://github.com/generaloss/network-forge/wiki) for full guides and API documentation.
---
## Related Projects
* [Resource Flow](https://github.com/generaloss/resource-flow) - utility library used by Network Forge