com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

Add functions to send and receive unconnected packets in Unity Transport

Open SubatomicPlanets opened this issue 1 year ago • 0 comments

This is a feature related to the Unity Transport, not Netcode for GameObjects directly, so I don't know if this is the right place. I want to send and receive packets without any connection. In my specific case, I want to send some data to a server. This server is made in C++ and has nothing to do with Unity. I just want to send something using the socket used by the Unity Transport.

I would like to see a function like .SendTo(message, IPEndPoint) and some way of receiving a response like .ReceiveFrom(IPEndPoint). They could be part of the NetworkDriver.

Right now I am using the Ruffles transport from the multiplayer-community-contributions. Ruffles allows me to send such packets using the .SendRaw function. This is not ideal, as I would like to use the official Unity Transport.

This would also allow an easy implementation of NAT hole punching.

SubatomicPlanets avatar Sep 21 '24 14:09 SubatomicPlanets