XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Exception in NetworkSession update

Last post 28/10/2009 14:46 by Milkstone Studios. 4 replies.
  • 12/08/2009 2:30

    Exception in NetworkSession update

    I'm currently doing multiple tests with my game and came upon an exception deep in the XNA networking code.

    I can repro the error very easily and I was wondering if anyone else was able to repro this issue (or if Microsoft could confirm that it is a valid issue in the XNA framework). If anyone can confirm, I can add it to MS Connect.

    My game supports having guests on each machine, this is important if you want to repro the exception. Those tests are done on Xbox through Xbox Live, using XNA GS 3.1.

    Here are the repro steps:
    1. Create a new Live session with only one local gamer signed-in.
    2. Have a remote gamer join your game with a guest (he should already have a guest signed in before joining your session).
    3. Have the remote gamer leave the session.
    4. Repeat steps 2 and 3 with the same gamers.
    I get the following crash after doing steps 2-3 about three times:

    A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.Xna.Framework.dll
    An unexpected error has occurred.

    Here's the call stack:

    Microsoft.Xna.Framework.GamerServices.GamerCollection`1.FindGamerWithInternalIndexAndRemove(Int32 index)
    Microsoft.Xna.Framework.Net.NetworkSession.ProcessGamerLeft(Byte*& readData)
    Microsoft.Xna.Framework.Net.NetworkSession.ProcessUpdateResults(Int32 outputDataSize)
    Microsoft.Xna.Framework.Net.NetworkSession.Update()
    ...

    I only get this error when the remote machine is joining with a guest. If the remote machine only has one player signed in, I don't get the crash.

    This error is also unrecoverable. The next time you call NetworkSession.Update(), the call stack stops at "Microsoft.Xna.Framework.Net.NetworkSession.ProcessUpdateResults(Int32 outputDataSize)" with an InvalidOperationException.

    The only way to recover is to Dispose the network session, which I'm doing in my game while giving the players an error message that the network session has ended.

    Thanks,
    Jean-François Pérusse
    Hot Potato Online : Available now! Developer profits go for Child's Play.
  • 12/08/2009 17:18 In reply to

    Re: Exception in NetworkSession update

    This doesn't ring any bells with me, sorry. Please do file it on Connect.
    XNA Framework Developer - blog - homepage
  • 12/08/2009 18:31 In reply to

    Re: Exception in NetworkSession update

    Thanks,

    Here's the link to the issue in Connect, if anyone ever has the issue as well.


    Hot Potato Online : Available now! Developer profits go for Child's Play.
  • 06/10/2009 4:38 In reply to

    Re: Exception in NetworkSession update

    Any updates to this issue? The workaround posted on the Connect website doesn't work, since the session has no knowledge of the missing gamer(s) and therefore cannot remove the associated machine (throws an "Operation is not valid due to the current state of the object" exception).
  • 28/10/2009 14:46 In reply to

    Re: Exception in NetworkSession update

    Got the same error on a game session we had Monday when a player with two guests left after around an hour playing with no issues. Seems like it doesn't happen too often though.
Page 1 of 1 (5 items) Previous Next