0

SITUATION: I am developing a game in with one instance running on a Linux server, and multiple instances running on Windows10 (MacOS support is planned). Network reliability has been an ongoing problem, and providing diagnostics might help players understand what is happening when they encounter network instability.

PROBLEM: Presently, I am relying on C#'s TCP and UDP library and am using IPGlobalProperties to gather information on networking failure rates. My understanding of the documentation is that this is gathering information for the whole computer.

GOAL: I want statistics only for data sent between instances of my program, any other sampling could bias my statistics. (Also, monitoring the user's whole computer seems invasive and in an ideal world would be flagged.)

NOTE: I would expect that this would be possible using TcpClient (and similar objects) to get this information, but I can't find any way to accomplish this.

==========

EDIT: Since the intention is for the monitoring to occur on a client (player's) computer, it must not be necessary for the client to launch the application with admin privileges, install any supporting framework, etc.

AngelGabriel
  • 694
  • 4
  • 12
  • 1
    In [this post](https://stackoverflow.com/questions/17026204/retrieve-process-network-usage), the answer uses event tracing on windows to gather the information – Oguz Ozgul Apr 12 '20 at 23:34
  • See following : https://learn.microsoft.com/en-us/dotnet/api/system.net.networkinformation.ipv4interfaceproperties?view=netframework-4.8 – jdweng Apr 12 '20 at 23:37
  • @jdweng That link provides information for a given network interface. The OP wants to get information regarding only their own process. – Oguz Ozgul Apr 12 '20 at 23:42
  • @OguzOzgul thank you, I'll see take at look at ETW and the Diagnostic PerformanceCounters as suggested. (They both seem to require admin privileges... and might not be cross-platform, but I'll give it a try.) – AngelGabriel Apr 13 '20 at 04:01
  • Not sure this question is really all that appropriate for Stack Overflow. It seems overly broad, since any number of answers could apply. That said, I think you may be overthinking it. Maybe ETW will provide what you want, but I'm almost certain that's not going to be cross-platform. But you can compute all your own stats for UDP, and you can probably do a good enough job inferring basic reliability metrics for TCP, by timestamping transmissions (things that take longer to arrive are probably subject to more retries somewhere along the line), and that'll all be inherently cross-platform. – Peter Duniho Apr 13 '20 at 05:00

0 Answers0