FastNet
Were migrating to FastNet2, recomanded using FastNet2 than FastNet, FastNet will no longer be updated, Thanks for using it!
FastNet - Depracated
Hello, everyone!
so, today i want to share my first time made networking system
This FastNet module is networking module with rateLimiter and queue system. but it’s really powerful (Very Fast, low latency, low bandwidth usages and high-performance)
also you can change the default FastNet settings in FastNet Module like this
Pros on FastNet:
- More secured with AES (very hidded secret key, optional on settings)
- Encoded data packets (automaticly decoded when receives)
- Low bandwidth usages (Highly compressed, the smallest is 2 bytes)
- Custom RateLimit to Player
- Stabled Efficiency & Optimized
- Faster
- Thread Reuse (Client)
- RateLimits & Queues System
- Debugging (optional)
- Traffic Logs
- Fire back after receive (optional, likely RemoteFunction)
- Easy to use
- Custom Timeout system (yielded) on RemoteFunction
- Anti-Spam on Remotes Receiver (optional)
Cons on FastNet:
- Disable RateLimiting & Queue make unstablled or very-high/massive limition size
- AES Encryption is slow when handling alots data to encrypted
- AddLimit / AddLimitAll may extra performance taken
- AES Encryption System enabled requires extra performance for secure their keys
- Easily RateLimit handler outdated (not at all)
Note: For version 2.9.x
Download Source
GitHub: here
Roblox Library: here
Download File (.rbxm, ver2.9.9-beta2, b_2990):
FastNet.rbxm (46.7 KB)
Example
-------- SERVER SCRIPT SIDE --------
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Network = require(ReplicatedStorage:WaitForChild("Network"))
-- Create New Remote (typeRemote, NameRemote)
local Remote1 = Network:Create("RemoteEvent", "Remote1")
local Remote2 = Network:Create("RemoteFunction", "Remote2")
-- RemoteEvent.OnServerEvent
Remote1:Listen(function(player, data_receive)
print(player, data_receive)
end):Connected("Remote1 Connected!")
-- RemoteFunction.OnServerInvoke
Remote2:Listen(function(player, data_receive)
print(player, data_receive)
end):Connected("Remote2 Connected!")
------ CLIENT LOCAL SCRIPT SIDE ------
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Network = require(ReplicatedStorage:WaitForChild("Network"))
-- Name Remote, data to sent
Network:Fire("Remote1", "Hello!")
Network:Invoke("Remote2", "Welcome!")
RateLimit Test
------ CLIENT LOCAL SCRIPT SIDE ------
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Network = require(ReplicatedStorage:WaitForChild("Network"))
while task.wait() do
task.spawn(function()
Network:Fire("Remote1", "Hello!")
Network:Invoke("Remote2", "Welcome!")
end)
end
Comparison Speedtests (Stress-Benchmark)
Benchmark 1 (FastNet v1.0-Beta)
Benchmark 2 (FastNet v1.0-Beta)
Benchmark 3 (FastNet v1.1-Beta)
Benchmark 4 (FastNet v2.0-release, 75 fires per frame)
Benchmark 5 (FastNet v1.3-beta, FastNet RateLimiter Settings disabled/off)
Benchmark 6 (FastNet v2.0-release, 30 fires per frame)
Benchmark 7 (FastNet v2.0-release, 125 fires per frame)
Benchmark 8 (FastNet v2.0-release, 75 fires per frame)
Benchmark 9 (FastNet v2.0-release, BridgeNet v2.0.0-rc4)
Benchmark 10 (FastNet v2.1-release, BridgeNet v2.0.0-rc4)
That pictures showing compare stress benchmark result using RunService.Heartbeat no delations for 30s (BridgeNet seems unstable), and FastNet Module is really keep stable to handle many Remote calls connection.
Note
BridgeNet Module 2.0.0-r3 version (except benchmark 9 & 10)
Latest version: 2.9.9 - Beta2
Stable version: 2.2/2.3/2.6/2.7/2.8.x/2.9.x - Beta