Skip to content

vovgou/DotNettyForUnity

 
 

Repository files navigation

DotNetty For Unity

release npm

DotNetty is a port of Netty, asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.

This version is modified based on DotNetty's 0.7.5 version and is a customized version for the Unity development platform. It removes some dependencies and has been tested under IL2CPP.

Fixes & Improvements

  • Removed assemblies System.Collections.Immutable,System.Threading.Tasks.Extensions and Microsoft.Extensions.Logging.
  • Added the Factory property to the InternalLoggerFactory to integrate the log printing feature of Unity.
  • Added ScheduleWithFixedDelay and ScheduleAtFixedRate methods for IScheduledExecutorService.
  • Added FixedDelayScheduledTask and FixedRateScheduledTask.
  • Added object pools for ActionTaskQueueNode, StateActionTaskQueueNode, and StateActionWithContextTaskQueueNode, and optimized GC.
  • Added ReusableScheduledTask,reuse ScheduledTask to reduce heap memory allocation.
  • Solved the bug that when the SocketDatagramChannel does not set localAddress, the channel cannot be activated and cannot receive any messages.
  • Fixed a bug of SocketDatagramChannel on MacOSX system,when the channel is already connected to an address, calling the SentTo function will throw an exception.
  • Fixed a bug,in the netstandard2.x library, the Write method of SslStream will switch threads, and the DoFinishWrap of TlsHandler needs to be switched to the thread bound to Channel.
  • Pool ByteBuffer objects to reduce GC.
  • Pool some frequently used objects to reduce GC
  • Roll back the version of ThreadLocalPool to avoid the bug that pooled objects cannot be recycled correctly when released by another thread.
  • Merge the "writevaluetask" branch of https://github.com/maksimkim/DotNetty into the project, and use ValueTask to optimize the GC of Task.

Installation

Install via OpenUPM

Modify the Packages/manifest.json file in your unity project, add the third-party repository "package.openupm.com"'s configuration and add "com.vovgou.dotnetty" in the "dependencies" node.

{
  "dependencies": {
    ...
    "com.unity.modules.xr": "1.0.0",
    "com.vovgou.dotnetty": "0.7.5"
  },
  "scopedRegistries": [
    {
      "name": "package.openupm.com",
      "url": "https://package.openupm.com",
      "scopes": [
        "com.vovgou"
      ]
    }
  ]
}

Install via NPM

Modify the Packages/manifest.json file in your unity project, add the third-party repository "npmjs.org"'s configuration and add "com.vovgou.dotnetty" in the "dependencies" node.

{
  "dependencies": {
    ...
    "com.unity.modules.xr": "1.0.0",
    "com.vovgou.dotnetty": "0.7.5"
  },
  "scopedRegistries": [
    {
      "name": "npmjs.org",
      "url": "https://registry.npmjs.org/",
      "scopes": [
        "com.vovgou"
      ]
    }
  ]
}

Contribute

We gladly accept community contributions.

About

DotNetty project – a port of netty, event-driven asynchronous network application framework

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.8%
  • Other 0.2%