Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8477931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:36:14+00:00 2026-06-10T18:36:14+00:00

I was given 10 new PCs, all (supposedly) with Windows 7 Pro freshly installed

  • 0

I was given 10 new PCs, all (supposedly) with Windows 7 Pro freshly installed and nothing else done to them.

I have a program, coded in Delphi XE2, using Indy 10 components for the networking. I set the “connect timeout” and “read timeout” properties of my TIdTcpCleint to 500ms, set “resuse socket” to ‘o/s dependant'” (I also tried a build with it set to No) and leave “use Nagle” (whatever that is set to True (I also tried with false).

Here’s the problem: when I run the same .EXE on these PCs and test the case where I pull the network cable, my debug trace shows the connect attempt / connect timeout happening in the same second or the next second (with a granularity of 1 second) – but on others it is 20 or 21 seconds before I see the conenction timeout.

It would seem some of that the PCs are not totally “fresh install” as claimed, although I see no aps installed. Maybe some one installed somethign then removed it, maybe they tried to tweak performance.

Before I reinstall Windows on 10 PCs, can anyone suggest where to look? Does 20 (or 21) seconds ring a bell with regard to TCP Client connect timeout?

[update] I am attempting to connect directly to a specific IP Address, so I am not sure if @Nikolai suggestion to check DNS is relevant. Sorry for not mentioning this originally.

[upperdate] the program does not attempt to keep the socket open. It connects, sends some data & disconnects – repeatedly, for each new piece of data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:36:15+00:00Added an answer on June 10, 2026 at 6:36 pm

    Sadly, this is working as intended. The connect did already timeout. Indy made the determination that the connect would fail in the 500 milliseconds that you asked it to. However, that does not guarantee the function will return.

    After the connect times out, Indy spins down the connection to release all of its resources. It does this synchronously. This means that you wind up waiting for the underlying TCP operation to fail. This typically takes 20 seconds.

    The solution is to call connect in a thread. Believe it or not, this is what Indy already does to implement the timeout. However, when it times out waiting for the thread, it tries to shut down the connection in the main thread. You need to defer that to a worker thread.

    As for why it happens immediately on some systems and in 20 seconds on others, it depends on the precise networking configuration. For example, if IPv6 is enabled, the stack may attempt to use an IPv6-to-IPv4 connection, and that may not report down even if the physical interface is down. Immediate detection of connection impossibility is never guaranteed and you shouldn’t rely on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been given a new project module which involves fuzzy logic. It is
Given client = new XMemcachedClient(server, port); What happens if I have several thread doing
I have been given a new task from the client which is basically creating
I have a table that needs to be given a new primary key, as
I have been given new project which has many classes and I have to
Could I have some feedback on this Given new House(x ) sends a string
Given a new screen in android i would like to iterate through all the
Given the new dynamic support in C# 4, is it possible to write a
Given var myHash = new Array(); myHash['key1'] = { Name: 'Object 1' }; myHash['key2']
Given a set Paris New York London New York Paris Paris I'm trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.