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

First packet sent by host never recived by client.

Last post 7/21/2008 3:32 PM by Leigon. 11 replies.
  • 7/17/2008 11:57 AM

    First packet sent by host never recived by client.

    The first packet since the server is started is never received by any client.

    In our game we send two packets during the Gamer Joined event from the server to the client that just joined (if the gamer that just joined is not itself).

    1. The first packet is around 150 bytes and contains all of the game settings, teams, game time etc and is sent ReliableInOrder OR Reliable to the e.Gamer that just joined.
    2. The second packet is around 20 bytes with just team data of the player that joined and is sent to everyone ReliableInOrder OR Reliable.

    In ether order the first packet never gets to the client.
    The client can re-join or another client can connect and they will receive both packets.
    Also no matter how I send the packets ReliableInOrder OR Reliable the first is never received.

    Is this a known bug with XNA? if not what do you think would cause this?

    Adrian Smith

    leigon.co.uk

    drizzle.liquidannihilation.com
  • 7/17/2008 4:47 PM In reply to

    Re: First packet sent by host never recived by client.

    Interesting... I've never seen this behavior, and our unit tests do some similar things that I would have expected to trigger the same thing you are seeing if it was a consistent bug.

    If you can put together a simplified repro app that shows this problem, could you file a bug on the Connect site and attach your repro code?

    Thanks!


    XNA Framework Developer - blog - homepage
  • 7/17/2008 11:24 PM In reply to

    Re: First packet sent by host never recived by client.

    Shure thing Shawn... I will make a demo app in the studio tomorow morning first thing.
    Adrian Smith

    leigon.co.uk

    drizzle.liquidannihilation.com
  • 7/18/2008 12:56 PM In reply to

    Re: First packet sent by host never recived by client.

    ok, I spent a few hours ripping out the networking into a test project and started testing...

    I could not re-create the bug but I think I found the undelying problem.
    If you asyncrisly join and send the client a joining packet, it recives it before the GamerJoined event is called. This causes problems as the GamerJoined re-sets what I am sending and init's the Gamer.tag. Some packets throw null exeptions because of this as the Gamer.tag is not set before the packets are recived.

    Do you still want me to send in a small demo code showing this crash?

    Thanks
    -Adrian

    Adrian Smith

    leigon.co.uk

    drizzle.liquidannihilation.com
  • 7/18/2008 1:44 PM In reply to

    Re: First packet sent by host never recived by client.

    That doesn't sound like a bug, it sounds like you're not doing things in the correct order and handling exceptions properly.
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 7/18/2008 2:36 PM In reply to

    Re: First packet sent by host never recived by client.

    Jim Perry:
    That doesn't sound like a bug, it sounds like you're not doing things in the correct order and handling exceptions properly.

    I send two packets on the server during GamerJoined... the clients get a packet before they think they have joined, but I have no way of holding the packets back untill XNA runs the GamerJoined event. I could throw in some wait flags before packet prosessing but personaly I think that packets should not be allowed to be recived untill the gamer has officaly joined the game session.

    Adrian Smith

    leigon.co.uk

    drizzle.liquidannihilation.com
  • 7/18/2008 4:11 PM In reply to

    Re: First packet sent by host never recived by client.

    I'd definately like to take a look at the repro code for this problem - not immediately sure if it's a bug or not but it can't hurt to take a look!
    XNA Framework Developer - blog - homepage
  • 7/21/2008 9:18 AM In reply to

    Re: First packet sent by host never recived by client.

    Shawn Hargreaves:
    I'd definately like to take a look at the repro code for this problem - not immediately sure if it's a bug or not but it can't hurt to take a look!

    Sorry for the late upload. The copy I took home to upload over the weekend did not copy properly.
    It is in connect under "Networking - Client Asyncrous Join - Packets can be recived before Gamer Joined event is called.".

    Thanks man.

    Adrian Smith

    leigon.co.uk

    drizzle.liquidannihilation.com
  • 7/21/2008 2:55 PM In reply to

    Re: First packet sent by host never recived by client.

    Hmm, is there a reason why I can't get the file attachment on this Connect item? :(
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 7/21/2008 3:19 PM In reply to

    Re: First packet sent by host never recived by client.

    I'm not 100% sure on this, but I think Connect bug attachements are only accessible by Microsoft and the person who posted them. Although the bug itself is public, that way you can attach repro cases without having to worry about accidentally releasing your game to the whole world.
    XNA Framework Developer - blog - homepage
  • 7/21/2008 3:23 PM In reply to

    Re: First packet sent by host never recived by client.

    Ahh, I can see the point in that. Although I can't imagine anyone attaching their whole game. :)
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 7/21/2008 3:32 PM In reply to

    Re: First packet sent by host never recived by client.

    Yep its MS only, I can't even download the attachment myself.

    Jim Perry:
    Ahh, I can see the point in that. Although I can't imagine anyone attaching their whole game. :)

    I don't think anyone would, but a repro demo still has code that is still the companies property. I.e. ours has our studio timers, input wrapper and network cliant server wrapper to try and re-crate the crash exactly as we see it in our game.

    If none MS employees got the code without prior permission I would proberly get kicked out the door here at our studio.

    Adrian Smith

    leigon.co.uk

    drizzle.liquidannihilation.com
Page 1 of 1 (12 items) Previous Next