Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

83 Commits

Repository files navigation

Maven Central

A lightweight and flexible Java networking library for building custom networked applications.

It provides packet-oriented TCP connections, fine-grained socket option control, and encryption with JCE ciphers.


Installation

Add the dependency from Maven Central:

<dependency>
<groupId>io.github.generaloss</groupId>
<artifactId>network-forge</artifactId>
<version>26.4.1</version>
</dependency>

Requirements:

  • Java 11 or higher

Quick Start

TCP Server

TCPServerserver = newTCPServer();
server.registerOnConnect(connection -> {
connection.send("Hello, client!");
});
server.registerOnReceive((senderConnection, data) -> {
Stringreceived = newString(data);
System.out.println(received); // Output: Hello, server!
});
server.registerOnDisconnect((connection, reason, e) -> {
server.close(); // Close server
});
server.run(5555);

TCP Client

TCPClientclient = newTCPClient();
client.registerOnReceive((connection, data) -> {
Stringreceived = newString(data);
System.out.println(received); // Output: Hello, client!client.close(); // Disconnect client
});
client.connect("localhost", 5555);
client.send("Hello, server!");

Documentation


Related Projects

About

Network Library

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages