 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Vladimir Zhuchko Guest
|
Posted: Sat Aug 05, 2006 5:14 pm Post subject: Trouble with the Last Indy9v with the CB6 vs. old Indy9 (ver |
|
|
I downloaded the latest indy9 for my CB6, installed it successfully and
build my old project, contained TIdTCPServer component.
After that my application can't get information from clients, clients
can connect, but AThread->Connection->ReadStream(mems, -1, true) can
read nothing!
I recompiled with old indy9 pack and got good result.
What is the difference? |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sun Aug 06, 2006 12:05 am Post subject: Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 |
|
|
"Vladimir Zhuchko" <zhuchko (AT) jinr (DOT) ru> wrote in message
news:44d48b8a$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I downloaded the latest indy9 for my CB6, installed it successfully
and build my old project, contained TIdTCPServer component.
After that my application can't get information from clients, clients
can connect, but AThread->Connection->ReadStream(mems, -1, true)
can read nothing!
|
You are specifying true for the AReadUntilDisconnect parameter. There is a
bug in the current snapshot where ReadStream() does not exit properly when
the connection is closed. It keeps looping. Inside of ReadStream(), change
this code:
if not (E is EIdConnClosedGracefully) or not AReadUntilDisconnect then
begin
raise;
end;
To this:
if (E is EIdConnClosedGracefully) and AReadUntilDisconnect then begin
Break;
end else begin
raise;
end;
Gambit |
|
| Back to top |
|
 |
Vladimir Zhuchko Guest
|
Posted: Sun Aug 06, 2006 1:22 am Post subject: Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: | "Vladimir Zhuchko" <zhuchko (AT) jinr (DOT) ru> wrote in message
news:44d48b8a$1 (AT) newsgroups (DOT) borland.com...
I downloaded the latest indy9 for my CB6, installed it successfully
and build my old project, contained TIdTCPServer component.
After that my application can't get information from clients, clients
can connect, but AThread->Connection->ReadStream(mems, -1, true)
can read nothing!
You are specifying true for the AReadUntilDisconnect parameter. There is a
bug in the current snapshot where ReadStream() does not exit properly when
the connection is closed. It keeps looping. Inside of ReadStream(), change
this code:
if not (E is EIdConnClosedGracefully) or not AReadUntilDisconnect then
begin
raise;
end;
To this:
if (E is EIdConnClosedGracefully) and AReadUntilDisconnect then begin
Break;
end else begin
raise;
end;
Gambit
Thank you, I'll try this. |
|
|
| Back to top |
|
 |
Vladimir Zhuchko Guest
|
Posted: Sun Aug 06, 2006 8:10 am Post subject: Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 |
|
|
Vladimir Zhuchko wrote:
| Quote: | Remy Lebeau (TeamB) wrote:
"Vladimir Zhuchko" <zhuchko (AT) jinr (DOT) ru> wrote in message
news:44d48b8a$1 (AT) newsgroups (DOT) borland.com...
I downloaded the latest indy9 for my CB6, installed it successfully
and build my old project, contained TIdTCPServer component.
After that my application can't get information from clients, clients
can connect, but AThread->Connection->ReadStream(mems, -1, true)
can read nothing!
You are specifying true for the AReadUntilDisconnect parameter. There
is a
bug in the current snapshot where ReadStream() does not exit properly
when
the connection is closed. It keeps looping. Inside of ReadStream(),
change
this code:
if not (E is EIdConnClosedGracefully) or not AReadUntilDisconnect
then
begin
raise;
end;
To this:
if (E is EIdConnClosedGracefully) and AReadUntilDisconnect then begin
Break;
end else begin
raise;
end;
Gambit
Thank you, I'll try this.
I tested this, now the application isn't freezing, but ReadStream does |
not working yet. I returned to the old version. |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Aug 07, 2006 10:54 pm Post subject: Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 |
|
|
"Vladimir Zhuchko" <zhuchko (AT) jinr (DOT) ru> wrote in message
news:44d59315$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I tested this, now the application isn't freezing, but ReadStream
does not working yet.
|
Please elaborate. What is the problem now?
Gambit |
|
| Back to top |
|
 |
Vladimir Guest
|
Posted: Tue Aug 08, 2006 8:10 am Post subject: Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: | "Vladimir Zhuchko" <zhuchko (AT) jinr (DOT) ru> wrote in message
news:44d59315$1 (AT) newsgroups (DOT) borland.com...
I tested this, now the application isn't freezing, but ReadStream
does not working yet.
Please elaborate. What is the problem now?
Gambit
The problem is simple, before changes the application was frozen within |
this function (ReadStream), but after application is working, but
ReadStream reads nothing. |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Aug 08, 2006 10:51 pm Post subject: Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 |
|
|
"Vladimir" <zhuchko (AT) jinr (DOT) ru> wrote in message
news:44d82469 (AT) newsgroups (DOT) borland.com...
| Quote: | The problem is simple, before changes the application was frozen
within this function (ReadStream), but after application is working,
but ReadStream reads nothing.
|
That is only possible if no data was transmitted over the socket to begin
with.
Gambit |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Aug 09, 2006 8:10 am Post subject: Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 |
|
|
"Vladimir Zhuchko" <zhuchko (AT) jinr (DOT) ru> wrote in message
news:44d965b6$1 (AT) newsgroups (DOT) borland.com...
| Quote: | No, not so. After recompiling of the project with
the old indy9 ReadSream is working well!
|
The only way for EIdConnClosedGracefully to be thrown is for the socket to
have returned 0 bytes received during the loop. Since the loop also writes
all pending data to the output stream, there is no way for ReadStream() not
to return all available data when a disconnect occurs. If you look at the
source code for ReadStream() in Indy 9 and 10, they are virtual identical.
Your problem has to be elsewhere. So again, I ask you to provide SPECIFIC
DETAILS about what EXACTLY you think is not working properly.
Gambit |
|
| Back to top |
|
 |
Vladimir Zhuchko Guest
|
Posted: Wed Aug 09, 2006 8:10 am Post subject: Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 |
|
|
Remy Lebeau (TeamB) wrote:
| Quote: | "Vladimir" <zhuchko (AT) jinr (DOT) ru> wrote in message
news:44d82469 (AT) newsgroups (DOT) borland.com...
The problem is simple, before changes the application was frozen
within this function (ReadStream), but after application is working,
but ReadStream reads nothing.
That is only possible if no data was transmitted over the socket to begin
with.
Gambit
No, not so. After recompiling of the project with the old indy9 |
ReadSream is working well! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|