Debugging Per-Channel Traffic?

Jormungandr
edited June 2014 in DotNet
I'm using the Unity3D SDK with a dedicated Photon server. Is there any way to debug what channel my incoming messages are received on?

Some background detail: we maintain separate channels for reliable and unreliable events, in order to prevent unreliable position updates from being interrupted when a reliable message is having trouble getting through. I'm seeing what looks like a reliable message being sent on that reserved-for-unreliable channel (and blocking said position updates when packet loss is introduced), but am so far unable to tell which message it is.

Possibly related: if I set my debug level to ALL, I'll get messages like the following logged:
queueIncomingCommand( NC(0|7 r/u: 3/280 st/r#/rt:0/0/0) )  -  incomingReliableSequenceNumber: 3
unreliable. local: 3/279 incoming: 3/280

Can someone provide an overview of what the values in those lines represent? (I'm hoping one of the numbers is the channel id...)

Comments

  • It's relatively uncommon that the Channels are being used (but actually clever and exactly correct the way you plan this), so I didn't expose them very well in the logs. Sorry about that being missing.

    The first number you get is the channel number. The full output is written as:
    String.Format("NC({0}|{1} r/u: {2}/{3} st/r#/rt:{4}/{5}/{6})", commandChannelID, commandType, reliableSequenceNumber, unreliableSequenceNumber, commandSentTime, commandSentCount, this.timeoutTime);

    Commands will carry your operations (to the server), responses (for ops from the server) and also events.
    CommandType 7 is unreliable, 6 is reliable and 8 a fragment.
    Unreliable commands have a unreliable sequence number and are in sequence with the reliable commands in the same channel as you probably already know.
    SentTime is a per-client value which is only useful to track roundtrip times and get a server-timestamp (which is the same on all clients, more or less).
    SentCount and TimeoutTime are only present for commands the client sent and track how often a command was sent already (if reliable) and when it will cause a timeout.

    I hope that helps.
  • Okay, that definitely helps.

    So can I reasonably expect to get the debug logs for each event right before that event is processed? At the moment it seems the only way to find what I want (is a given event reliable or not, and what channel did I receive it on?) is to parse this debug output and associate it with the next event I get.

    What I would ideally like is a way to directly get the channel and reliability values for a given event as I process it (so inside IPhotonPeerListener#OnEvent, OnOperationResponse, etc). If you're taking feature requests, this would be rather handy...
  • The log entry above does not relate to the dispatched response or event. It's logged when the incoming command is being queued.
    I can build you a custom library that logs or exposes the current command in dispatch. This will give you the info you need.
    I will mail you directly.