The International Simutrans Forum

 

Author Topic: [nettool] Timeout as optional parameter  (Read 1935 times)

0 Members and 1 Guest are viewing this topic.

Offline Michael 'Cruzer'

  • Devotee
  • *
  • Posts: 196
  • Founder of pak192.comic
    • Marktplatz für Parkplätze
  • Languages: DE, EN
[nettool] Timeout as optional parameter
« on: November 12, 2014, 04:23:55 PM »
Since nettool is very handy for usage in scripting it would be great if someone would be able to define some timeout to be used after which nettool should cancel it's work.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: [nettool] Timeout as optional parameter
« Reply #1 on: November 13, 2014, 04:04:20 PM »
The timeout is usually given by the system. I think it was around 90s on windows and 15s on Linux.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5555
  • Languages: EN, NO
Re: [nettool] Timeout as optional parameter
« Reply #2 on: November 13, 2014, 08:22:26 PM »
I think that depends on what is timing out. I've seen dead TCP connections hanging for days. Apparently, the TCP stack can only detect that the connection is dead if attempts are being made at sending something. It can't know that the lack of traffic is because the peer is dead, and not just due to the fact that the peer has nothing to say. Read timeouts must be specified by the application, because only it can know when to expect an answer.

That is assuming that the request has anything to do with network connections at all, and not timeouts on some potentially time consuming processing inside nettool itself (about which I know nothing).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: [nettool] Timeout as optional parameter
« Reply #3 on: November 13, 2014, 11:00:44 PM »
nettool uses 10s timeout for nearly everything (only 60s during game transfer). At which action it hangs exactly?

Offline Michael 'Cruzer'

  • Devotee
  • *
  • Posts: 196
  • Founder of pak192.comic
    • Marktplatz für Parkplätze
  • Languages: DE, EN
Re: [nettool] Timeout as optional parameter
« Reply #4 on: November 16, 2014, 09:14:11 AM »
I didn't intended the TCP timeout. My script uses it to check the online players of localhost but I don't wanted it to get hang when a sync is forced (like login/logout).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: [nettool] Timeout as optional parameter
« Reply #5 on: November 16, 2014, 09:16:58 PM »
Sorry, I am lost. I have never ever used nettool, so I have no idea how it works and when it can hang.