Re: Socket operation on non-socket

Giganews Newsgroups
Subject: Re: Socket operation on non-socket
Posted by:  Remy Lebeau \(Indy Team\) (
Date: Thu, 14 Feb 2008

"sunrizer" <sunriz…> wrote in message

> When I try to connect to the SMTP-server, which currently unavailible
> - TIdSMTP raises EIdNotASocket and EIdConnectTimeOut in one
> moment. Is it a bug ?

No, that is perfectly normal.  At the API layer, a blocking socket does not
have any timeout capability when connecting to a server.  So Indy uses a
separate thread to handle it.  If the thread takes too long to establish the
connection (as specified in the ConnectTimeout property), then Indy closes
the socket, raising the EIdNotASocket exception in the context of the
connecting thread (and thus your code will never see it but the debugger
will), and then raises the EIdConnectTimeOut exception (which your code will




In response to

Socket operation on non-socket posted by sunrizer on Thu, 14 Feb 2008