Skip to content

Repository files navigation

libdatachannel-java (NGE)

License: MPL 2.0

This is a fork of libdatachannel C Java wrappers: libdatachannel-java intended to be used within the Nostr Game Engine codebase.

The fork diverges from the original repository in few key areas:

  • Direct ByteBuffer allocation can be wired to a custom allocator
  • Mimalloc (w/ MI_SECURE) for internal allocations on the jni binding side.
  • JUL instead of SLF4J for logging.

Usage

Windows, MacOS, Linux

implementation("org.ngengine:libdatachannel-java:0.24.1.nge8")
implementation("org.ngengine:libdatachannel-java-arch-detect:0.24.1.nge8")

Bundled desktop natives are extracted together with their dependencies into a new private directory for each load. The loader tries java.io.tmpdir, the user cache, and then ~/.nge/natives/datachannel-java, rejecting unsafe directories and non-executable filesystems. Extracted files are scheduled for removal at normal JVM exit. To manage extraction externally, set libdatachannel.native.datachannel-java.path to the absolute native library path and place its allocator dependency beside it.

Android

implementation("org.ngengine:libdatachannel-java:0.24.1.nge8")
implementation("org.ngengine:libdatachannel-java-android:0.24.1.nge8")

To use libdatachannel on Android, the following permissions are required:

  • android.permission.INTERNET

iOS with libJGLIOS

implementation("org.ngengine:libdatachannel-java:0.24.1.nge8")
implementation("org.ngengine:libdatachannel-java-ios:0.24.1.nge8")

The iOS module bundles LibDataChannelJava.xcframework, LibSSL.xcframework, and LibCrypto.xcframework under lib/ios, so libJGLIOS can link the correct device or simulator slices from the runtime classpath.

Building

Native Bootstrap versions come from the shared NGE catalog, mirrored in gradle/nge.versions.toml. Snapshot builds use nativeBootstrapSnapshot; release builds use nativeBootstrap. Run ./gradlew refreshCatalog to update the catalog.

About

A fork of libdatachannel C Java wrappers: libdatachannel-java intended to be used within the Nostr Game Engine codebase.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages