- Move 'factory' functions to be methods on ICESessionInterface
- Delete CRecvSTUNPktCallback, callback can be just a simple pointer to
method
- Serialize the request once instead of saving off attributes and
complicated memorty management.
Delete UpdateHostCandidates, just create the host candidate immediately
when we create the interface.
Also delete ICECandidateBase::CalcPriority. We only called that when
adding a new local candidate, so just do the work directly in the
constructor.
Not the local candidate! A "local candidate" is a thing that we need to
tell our peer about, but when we need to send or receive packets, we
use a socket. When a socket has a host candidate, a server reflexive
candidate, etc, we don't really know or care which of those candidates
the peer used to talk to us.
Also, deleted IsCandidatePermitted. We need this, but the place we were
calling it was wrong.
Delete UnpackSTUNHeader and IsValidSTUNHeader. Combine them and
expand them inline at the only place we need to do this.
Rename DecodeSTUNPacket to ParseSTUNAttributes. It will get a copy
of the header already parsed, and will assume that the packet has
already been verified to be STUN.
Rename CSteamNetworkingSocketsSTUNRequest::OnPacketReceived to
ReplyPacketReceived and pass in what we have already parsed.
Delete return value, which was unused by only call site also
referred to silly nonsensical constants
This removes several places where we need to lookup the interface.
But since we are storing a pointer, it means now we need to make sure
and carefully cleanup if an interface drops out of the interface list.
There was a nested type CSteamNetworkingICESession::ICECandidateType,
which was named very confusingly similar to EICECandidateType. That
type uses different enum values based on the address family.
Renamed it to ICECandidateKind, made it an enum class, and promoted
to global scope.
Also, moved RFC5245CandidateAttr so we don't have to forward declare
it.
Simplify GatherInterfaces
Store the interface vector indirectly. This makes is so that we don't
have to define the move constructors/assignment, needed so that we can
remove items from the list. Also, looking ahead, I want the callbacks
to have a pointer to their interface, which will remove a little bit
of lookup work, and this will require stable pointers.
Make sure we test a super common and important scenario: two hosts
on the same LAN that *also* have the same gateway, and thus could
talk thorugh a hairpinned public route, but should use the LAN
route instead based purely on priority numbers, not latency
There can be more than one gateway. (E.g. cell connection and local
internet connection.) Each interface is assigned to one gateway,
or none of the interface is public.
Add ability to tag an adapter as non-functioning.
Simulate network latency.
Add more test cases.