🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
9 messages
9 total messages Started by Vladimir Zhuchko Sat, 05 Aug 2006 12:14
Trouble with the Last Indy9v with the CB6 vs. old Indy9 (vers. about 2 years ago)
#2170
Author: Vladimir Zhuchko
Date: Sat, 05 Aug 2006 12:14
8 lines
1360 bytes
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?
Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 (vers. about 2 years ago)
#2171
Author: Remy Lebeau (TeamB)
Date: Sat, 05 Aug 2006 19:05
30 lines
1892 bytes
"Vladimir Zhuchko" <zhuchko@jinr.ru> wrote in message
news:44d48b8a$1@newsgroups.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
Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 (vers. about 2 years ago)
#2172
Author: Vladimir Zhuchko
Date: Sat, 05 Aug 2006 20:22
33 lines
2057 bytes
Remy Lebeau (TeamB) wrote:
> "Vladimir Zhuchko" <zhuchko@jinr.ru> wrote in message
> news:44d48b8a$1@newsgroups.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.
Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 (vers.about 2 years ago)
#2173
Author: Vladimir Zhuchko
Date: Sun, 06 Aug 2006 06:58
40 lines
2227 bytes
Vladimir Zhuchko wrote:
> Remy Lebeau (TeamB) wrote:
>> "Vladimir Zhuchko" <zhuchko@jinr.ru> wrote in message
>> news:44d48b8a$1@newsgroups.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.
Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 (vers.about 2 years ago)
#2174
Author: Remy Lebeau (TeamB)
Date: Mon, 07 Aug 2006 17:54
11 lines
1243 bytes
"Vladimir Zhuchko" <zhuchko@jinr.ru> wrote in message
news:44d59315$1@newsgroups.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
Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 (vers.about 2 years ago)
#2076
Author: Vladimir
Date: Tue, 08 Aug 2006 05:43
16 lines
1649 bytes
Remy Lebeau (TeamB) wrote:
> "Vladimir Zhuchko" <zhuchko@jinr.ru> wrote in message
> news:44d59315$1@newsgroups.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.
Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 (vers.about 2 years ago)
#2078
Author: Remy Lebeau (TeamB)
Date: Tue, 08 Aug 2006 17:51
13 lines
1494 bytes
"Vladimir" <zhuchko@jinr.ru> wrote in message
news:44d82469@newsgroups.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
Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 (vers.about 2 years ago)
#2079
Author: Vladimir Zhuchko
Date: Wed, 09 Aug 2006 04:33
17 lines
1654 bytes
Remy Lebeau (TeamB) wrote:
> "Vladimir" <zhuchko@jinr.ru> wrote in message
> news:44d82469@newsgroups.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!
Re: Trouble with the Last Indy9v with the CB6 vs. old Indy9 (vers.about 2 years ago)
#2080
Author: Remy Lebeau (TeamB)
Date: Wed, 09 Aug 2006 06:47
17 lines
1940 bytes
"Vladimir Zhuchko" <zhuchko@jinr.ru> wrote in message
news:44d965b6$1@newsgroups.borland.com...

> 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads