I added a connection test mode 'cursory' which just makes
sure we can bind and exchange packets. We don't need to
test every variation with a soak or even quick test.
WIP. It could definitely do more, but this code at least exercises the library
at a relatively high bitrate.
Also, rename lane_basics to lane_quick_queueanddrain
p4:6869017
Visible changes:
- Uncomment ConfigureConnectionLanes
- Rename GetQuickConnectionStatus to GetConnectionRealTimeStatus, and change
the prototype to return information about multiple lanes.
- Adding a test case to send data on more than one lane and make sure we get
the priorities we expect.
- Also refactored the test-connection so that you specify what test(s) to
run on the command line, instead of using the LIGHT_TESTS compile-time
option.
- Bump interface version numbers.
Internal changes/bugfixes:
- Fix bug with my implementation of fair queuing. I was always calculating
the finish time for a lane based on the current virtual time. But really
it must be calculated from the time when the previous message in the same
lane finishes. Otherwise you don't share the bandwidth properly when it
alternates lanes. To keep the implementation simple, I just tag each
message with the virual finish time. I believe that this can actually
cause the virtual time to go in reverse if you queue a message on an idle
lane and we swap the active lane while sending is in progress. But I
think it's OK right now, and we will actually do the right thing and get
back on track after a message or two. To make room for this variable,
I shuffled around how we had shoved in reliable bookkeeping in
CSteamNetworkingMessage.
- Fix bug selecting the next message to send. We were ignoring the priority
classes and just using virtual time!
- Fix some bad hex math encoding and decoding the lane select frame.
- Fix some bugs that were confused about which set of links were used to
track the list of messages in a particular lane
- Fix bug when serializing segments from multiple lanes, only one of the
lanes will get to take advantage of the special segment encoding where
the segment length is implied by the packet size.
- Reorder the fields in SSNPSenderState::Lane to pack them a bit better
Fixes issue #95.
P4:6865294
Now you can register standard function pointers, instead of deriving
from a special class. This means that Steam and the opensource code
can now work the same, so this fixed issue #124
This should unbreak the Travis builders, which were taking more than an
hour to finish before. And since Travis changed the maximum runtime to
50 minutes, we hit the time limit and broke.
We just need to ensure these things run without crashing and try to hit
as many code paths as possible with various compilers/sanitizers, not do
long running tests with unusual network conditions.
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
Travis is taking far too long to give us data, and we just want to do
quick sanity test runs on there.
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
Also:
- STEAMNETWORKINGSOCKETS_STEAM now mens "running on steam", not "running using
the steam client". STEAMNETWORKINGSOCKETS_STEAMCLIENT is for that.
- Refactored stats stuff, moved it into the namespace. At one point I thought
I might expose some stuff in a public interface. For now, keeping it internal.
- Removed concept of Steam "universe" from this branch of the code.
- Don't use OVERRIDE, override works.
- Print CSteamIDs in 64-bit, to be consistent and make them easy to
print/parse without linking in anything.
- Actually implement the parsing, instead of the function body being
Assert(false)
- Added an (extremely bare bones) unit test, in a place in the code
that is totally inapproriate, but also totally convenient.
This is not really needed to confirm functionality, but logging the stats is useful to compare changes in performance. (I'm about to check in a big one.)
Moved them to ISteamNetworkingUtils, which is now actually shared Steam (mostly) with a real accessor and and interface, and not a dummy interface object with all static methods.
Connection settings have a system of inheritance, so they can be set globally, per SteamNetworkingSockets interface, per listen socket, or per connection.
Deleted the config variable to simulate fake *message* loss. That is not useful.
Introduced STEAMNETWORKINGSOCKETS_ENABLE_SDR define, to make it more clear why code is being #ifdef'ed out. (E.g. if we open-sourced that code, we would want that included.)
Replaced ESteamNetworkingSendType with a basic flags bitmask.
Cleaned up a bunch of comments.
Changed SteamNetworkingMessage_t release mechanism. Now the callback is only to free the buffer, and it's assumed that this API will manage the actual objects. (This is important because the actual type is a derived type and has extra stuff on the end.) Also laid some groundwork for user management of message objects. (Relevant for issue #51.)
Make it a method of ISteamnetworkingUtils method. This matches Steam.
Make sure ESteamNetworkingSocketsDebugOutputType is 32-bits, and declare the output callback to take an enum instead of int.
Also moved a bunch of Steam-specific stuff to other files, which are not included in this repository.
Moved high level init/kill to a seperate file, so that isteamnworkigsockets.h won't be cluttered with
a bunch of #ifdefs.
Added IClient interface layer, which is useless in this context, butneeded in Steam, since we
provide backwards compatibility for all old ISteamXxx interfaces.
This doesn't exist in the Steamworks SDK, so moving it to a seperate file means that the files that are in both branches can have fewer differences.
Deleted the "GameServer" interface. That is a Steamworks thing. I'll add another method to create additional interfaces later, if we need them.
CreateSocketPair now allows you to assign the identities to each end of the pipe.
Fix some really basic irritating issues trying to use ordinary UDP and loopback connections without an identity. Make it more straightforward to just use generic identity with no authentication.
* Interface changes:
Replaced all CSteamIDs with SteamNetworkingIdentity, which is an abstract concept.
Added IPv6 support. This has not been tested at this time, but all the basics
are there and any issues should be small bugfixes.
Improved and standardized connection debug names. You can set a debug name for a connection,
and the full debug string, which includes the Connection ID, transport-specific data, and
your name (if any) are printed consistently in logging messages and this name is also present
in SteamNetConnectionInfo_t. Connection handles are now the same as the local ConnectionID
on the wire. This makes debugging a lot easier.
GetListenSocketInfo renamed to GetListenSocketAddress and now actually does something.
Split out P2P and ordinary UDP listen sockets into two seperate objects. This simplifies
the opensource code (since P2P is not support)
* Misc internal code cleanup:
Broke up CCrypto monolith, so that we can more easily and cleanly:
- Share what we really want to share with Steam. Mainly some text parsing of keys, etc.
- Replace the actual crypto primitives with another provider (e.g. libsodium)
Delete a whole bunch of unused and messy cruft that was left when we ripped this out from Steam,
as well as code and messages specific to relayed connections (supported only on Steam)
Switch a bunch of maps to hashmaps instead of red/black tree maps. The CUtlHashMap class comes
from Steam and is designed to scale to very large size (N in the millions), and if the table
needs to be rehashed, the cost is amortized instead of triggering a large cost all at once.
This functionality is not needed. Nor do we need stable handles, so it would be better to use
a table based on open addressing. That would be a small optimization and also allow us to
get rid of bitstring.*, which unfortunately got added as a result of this change.
Added standalone IPv6 address parsing files: ipv6text.*. These are plain C and do not have
any dependencies, and could be split out, since they are independenctly useful and, unlike
all of our other utility routes (e.g. tier0, tier1, etc), actually worthy of being used
outside of Valve.
This not only removes some redundancy, but also is a step towards rejecting duplicate sequence numbers earlier. (#20)
Also rework how hosted dedicated servers are configured, but that is not relevant to the opensource version of this code.