Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: Access violation inside TIdTCPClientCustom

www.cryer.info
Managed Newsgroup Archive

Re: Access violation inside TIdTCPClientCustom

Subject:Re: Access violation inside TIdTCPClientCustom
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Tue, 22 Jan 2008 12:16:18

"Michael Stieler" <michael.stieler@rie.eu> wrote in message
news:4795d9ac$1@newsgroups.borland.com...

> Okay , we are using Version 10.1.6.

That is a very old version.

> The poll thread is running because it handles multiple connections.
> The way it works shouldn't do anything during a Connect() command.

Based on what you have described so far, your thread is trying to access a
client before it is ready to be accessed.  I suggest you maintain a
per-client flag that the thread can look for so it only tries to poll from
clients that are successfully connected.  DO NOT DO ANYTHING with a client
that is still in the process of trying to connect to its respective server.
In fact, I would suggest your polling thread maintain a thread-safe dynamic
list of clients, and then don't even add a client to the list until it is
fully connected.  If any thread detects the client is no longer connected,
remove the client from the list immediately so it can't be polled anymore.

> A simplified example of what the poll thread does:
<snip>

If the polling thread is the only one who ever calls Connect(), then there
is no way the IOHandler could be nil inside of Connect().  Your earlier
descriptions suggest that you are calling Connect() outside of the polling
thread.  Is that actually the case?


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive