Skip to content

Repository files navigation

Swift NIO Fusion

The FusionBootstrap is a custom network listener that implements the Fusion Framing Protocol (FFP) It is built on top of the Swift-NIO library. This fast and lightweight custom framing protocol enables high-speed data transmission and provides fine-grained control over network flow.

Overview

Swift Version License
Swift 6.2 License
Swift 6.2

Installation:

Swift Packages

// ...
dependencies: [
    // Dependencies declare other packages that this package depends on.
    .package(url: "https://github.com/Vinz1911/swift-nio-fusion", exact: "1.0.0"),
]

// in targets
dependencies: [
    .product(name: "NIOFusion", package: "swift-nio-fusion")
]
// ...

Import:

// Import the Framework
import NIOFusion

// Create the bootstrap listener
let bootstrap = FusionBootstrap(from: .init(host: "0.0.0.0", port: 7878))

// ...

Bind Bootstrap:

// Import the Framework
import NIOFusion

// Create the bootstrap listener
let bootstrap = FusionBootstrap(from: .init(host: "0.0.0.0", port: 7878))

// Receive result
Task {
    for try await result in bootstrap.receive() {
        // Handle `FusionResult`, simple echo server
        try await bootstrap.send(id: result.id, message: result.message)
    }
}

// bind bootstrap
try await bootstrap.bind()

About

A fast, lightweight custom network listener built on top of Apple’s NIO framework

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages