Builds off #149 to allow NetcodeServerTransport to internally manage multiple TransportSockets. This is done by 'domain-separating' the client address space between each socket with a 'socket id'. It is important that sockets don't have overlapping address spaces so the netcode protocol can properly enforce connection invariants.
With this PR, you can have a UdpSocket and WebTransport socket providing packets to the same NetcodeServer, which makes it safe for clients to switch sockets mid-game! If you don't share NetcodeServer then it is not safe to allow socket switching (without some hairy and hard-to-validate engineering) because it is not possible/easy to enforce that a client only has one connection to the server.
At this point I don't have high hopes for these PRs to be merged, but I am presenting them nevertheless.
Builds off #149 to allow
NetcodeServerTransport
to internally manage multipleTransportSockets
. This is done by 'domain-separating' the client address space between each socket with a 'socket id'. It is important that sockets don't have overlapping address spaces so thenetcode
protocol can properly enforce connection invariants.With this PR, you can have a
UdpSocket
andWebTransport
socket providing packets to the sameNetcodeServer
, which makes it safe for clients to switch sockets mid-game! If you don't shareNetcodeServer
then it is not safe to allow socket switching (without some hairy and hard-to-validate engineering) because it is not possible/easy to enforce that a client only has one connection to the server.At this point I don't have high hopes for these PRs to be merged, but I am presenting them nevertheless.