All Projects → klaus7 → jfastnet

klaus7 / jfastnet

Licence: Apache-2.0 License
Fast, reliable UDP messaging for Java. Designed for games.

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to jfastnet

Valvesockets Csharp
Managed C# abstraction of GameNetworkingSockets library by Valve Software
Stars: ✭ 273 (+950%)
Mutual labels:  gamedev, udp
udpt
UDP Transport: compress, encrypt and send any data reliably over unreliable UDP connections
Stars: ✭ 40 (+53.85%)
Mutual labels:  udp, messaging
rmnp
Realtime Multiplayer Networking Protocol
Stars: ✭ 41 (+57.69%)
Mutual labels:  udp, reliable-udp
Enet Csharp
Reliable UDP networking library
Stars: ✭ 464 (+1684.62%)
Mutual labels:  gamedev, udp
Laminar
A simple semi-reliable UDP protocol for multiplayer games
Stars: ✭ 530 (+1938.46%)
Mutual labels:  gamedev, udp
Enet
⚡️ ENet reliable UDP networking library
Stars: ✭ 202 (+676.92%)
Mutual labels:  gamedev, udp
Netdynamics
Data-oriented networking playground for the reliable UDP transports
Stars: ✭ 65 (+150%)
Mutual labels:  gamedev, udp
kcp-dotnet
KCP dotNet Core implementation
Stars: ✭ 26 (+0%)
Mutual labels:  gamedev, udp
liftbridge-api
Protobuf definitions for the Liftbridge gRPC API. https://github.com/liftbridge-io/liftbridge
Stars: ✭ 15 (-42.31%)
Mutual labels:  messaging
rfc
Modular p2p messaging stack, with a focus on secure messaging.
Stars: ✭ 81 (+211.54%)
Mutual labels:  messaging
roadifier
Open Source road mesh generator script for Unity
Stars: ✭ 30 (+15.38%)
Mutual labels:  gamedev
opengnb
GNB is open source de-centralized VPN to achieve layer3 network via p2p with the ultimate capability of NAT Traversal.GNB是一个开源的去中心化的具有极致内网穿透能力的通过P2P进行三层网络交换的VPN。
Stars: ✭ 440 (+1592.31%)
Mutual labels:  udp
xtory
a tool for writing branching nonlinear stories.
Stars: ✭ 14 (-46.15%)
Mutual labels:  gamedev
ebook
Third edition of the Computer Networking: Principles, Protocols and Practice ebook
Stars: ✭ 64 (+146.15%)
Mutual labels:  udp
iniquity
A re-imagining of the iconic BBS software.
Stars: ✭ 35 (+34.62%)
Mutual labels:  messaging
trophy-hunter
Trophy Hunter is a League of Legends companion app for the Overwolf store
Stars: ✭ 21 (-19.23%)
Mutual labels:  gamedev
libgdx-template
🎮 Starter project for libGDX. Perfect for Game Jams.
Stars: ✭ 18 (-30.77%)
Mutual labels:  gamedev
AG NTRIP ESP
AG Rooftop controller with NTRIP client and IMU (ESP32 Controller)
Stars: ✭ 25 (-3.85%)
Mutual labels:  udp
superfeather
SNES game engine in 65816 assembly, focusing on performance, flexibility, convenience
Stars: ✭ 31 (+19.23%)
Mutual labels:  gamedev
antkeeper-source
💿🐜 Antkeeper source code (GitHub mirror)
Stars: ✭ 23 (-11.54%)
Mutual labels:  gamedev

JFastNet

Fast, reliable and easy UDP messaging for Java. Designed for games.

JFastNet is tolerant towards packet loss and when used in the right way it can provide your players with a smooth network gaming experience even in bad network conditions.

The API of this library is subject to change.

Maven

The dependency for your POM:

<dependency>
    <groupId>com.jfastnet</groupId>
    <artifactId>jfastnet</artifactId>
    <version>0.3.8</version>
</dependency>

Example code

The following code shows the important parts of a server-client communication:

Server server = new Server(new Config().setBindPort(15150));
Client client = new Client(new Config().setPort(15150));

server.start();
client.start();
client.blockingWaitUntilConnected();

server.send(new PrintMessage("Hello Client!"));
client.send(new PrintMessage("Hello Server!"));

Click to see full sample code of HelloWorld.java

Roadmap

  • More documentation

Documentation

The documentation is still a work-in-progress.

The most important classes to look for in the beginning are the Config and the Message class. The JavaDoc there should provide you with the basic configuration possibilities of the library.

Reliable sending

There are currently two ways you can use to send a message in a reliable way. Sending the message unreliably is of course also an option.

  1. Acknowledge packet
  2. Sequence number

Acknowledge packet

The receiver of a message with reliable mode set to ACK_PACKET will send an acknowledge packet to the other end upon receipt of the message. As long as the sender of the prior mentioned message doesn't receive an acknowledge packet it will keep resending the message.

Attribute Value
Reliable yes
Ordered no

Sequence number

The receiver of a message with reliable mode set to SEQUENCE_NUMBER will do nothing as long as the messages arrive in the expected order. But if a message with an id greater than expected is received, the receiver will stop processing the messages and send a RequestSeqIdsMessage to the other end. Processing will not continue until all required messages are received.

Attribute Value
Reliable yes
Ordered yes

It's usually advisable to use sequence numbers, as there will be less overhead and also the ordered delivery is guaranteed.

Build

Use maven to build JFastNet:

mvn clean install

Thanks

Kryo is the default serialiser used in JFastNet and is a pleasure to work with! Thanks very much for this awesome library!

Project Lombok also deserves a mention, as it makes working with Java much more comfortable and the code looks cleaner. Check it out if you don't have already.

Contact

Post issues to the issues page or contact me via email at [email protected] for other inquiries.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].