Timeout when debugging

Options
MEX
MEX
edited January 2013 in Photon Server
I'm trying to implement a method to pause the game for all clients when one hits a breakpoint (http://gafferongames.com/networking-for ... yer-games/). My problem is that the client (which I debug) gets disconnected due to inactivity. Is there a way to set up the server, so that there are no timeouts?

Comments

  • dreamora
    Options
    No, that is not possible.
    the best you can do is a long timeout.
  • MEX
    Options
    Thanks for the reply. The maximum value for the timeout seems to be 1 minute (60000 ms), what will soon be too less to debug. Are there any features that support debugging? How do you approach debugging?
  • If it's possible for you: use TCP instead of UDP on your clients and disable the timeout on your TCP listener in PhotonServer.config like this:

    [code2=xml]<TCPListener
    IPAddress="0.0.0.0"
    Port="4530"
    InactivityTimeout="0"
    />[/code2]
  • MEX
    Options
    Nicole wrote:
    If it's possible for you: use TCP instead of UDP on your clients and disable the timeout on your TCP listener in PhotonServer.config like this:

    [code2=xml]<TCPListener
    IPAddress="0.0.0.0"
    Port="4530"
    InactivityTimeout="0"
    />[/code2]

    This method to stop the other clients should only be used temporarily anyway, so I could use TCP only for these debugging sessions. With this I wouldn't even have to change the config file every time, but use the preprocessor instead. Thanks for the tip :)
  • xzlxt720
    Options
    MEX wrote:
    Nicole wrote:
    If it's possible for you: use TCP instead of UDP on your clients and disable the timeout on your TCP listener in PhotonServer.config like this:

    [code2=xml]<TCPListener
    IPAddress="0.0.0.0"
    Port="4530"
    InactivityTimeout="0"
    />[/code2]

    This method to stop the other clients should only be used temporarily anyway, so I could use TCP only for these debugging sessions. With this I wouldn't even have to change the config file every time, but use the preprocessor instead. Thanks for the tip :)

    "This method to stop the other clients should only be used temporarily anyway", how to do if you don change the config file?
  • MEX
    Options
    xzlxt720 wrote:
    "This method to stop the other clients should only be used temporarily anyway", how to do if you don change the config file?

    I set up the config file once (TCPListener -> InactivityTimeout="0" as described above). In the code I simply check whether it's debugging mode or not (TCP or UDP).
    #define DEBUGGING_MODE 1
    ...
    #if DEBUGGING_MODE
    	m_litePeer = new ExitGames::Photon::LitePeer(&listener, true); // true means using tcp
    #else
    	m_litePeer = new ExitGames::Photon::LitePeer(&listener); // default is udp
    #endif
    

    The same happens every time there are differences in debug mode or nomal mode, like using the correct port when connecting:
    #if DEBUGGING_MODE
    	client.Connect("localhost:4530");
    #else
    	client.Connect("localhost:5055");
    #endif
    

    The only thing I have to do when switching the mode is to change the define of DEBUGGING_MODE to 1 or 0. (In C# the preprocessor commands had to be replaced with normal code)
  • Kaiserludi
    Options
    I would just do it this way to reduce redundancy in code:
    [code2=cpp]new ExitGames::Photon::LitePeer(&listener, DEBUGGING_MODE);

    client.Connect(ExitGames::Common::JString(L"localhost:") + (DEBUGGING_MODE?L"4530":L"5055"));[/code2]

    When you are not changing the ports in the server config, then you could also just write the second line as
    [code2=cpp]client.Connect(L"localhost");[/code2]
    and the C++ Client lib will choose the default port for the used protocol.

    Another option would be to use our provided debugging facilities:
    [code2=cpp]new ExitGames::Photon::LitePeer(&listener, DEBUG_RELEASE_S(true, false));[/code2]

    But this is all a matter of individual taste, style, preferences and needs. Your code is absolutely fine, too.
  • MEX
    Options
    Thanks for the tips :)