🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #1211

Re: About TIdTCPClient receive buffer...

#1211
From: Remy Lebeau (TeamB)
Date: Thu, 01 Mar 2007 20:09
27 lines
1688 bytes
"Umberto Spagnoli" <jumby@tiscali.it> wrote in message
news:45e717b9$1@newsgroups.borland.com...

> Please, could you post a sample code using ioctlsocket() API
function ?

    u_long bytes = 0;
    if( ioctlsocket((SOCKET)IdTCPClient1->Socket->Binding->Handle,
FIONREAD, &bytes) == 0 )
    {
        // bytes specified the number of unread bytes in the socket's
internal buffer...
    }

Typically, you should need to use the socket API directly when using
Indy, though.  An alternative approach is to simply call the
connection's ReadFromStack() method to read all pending data into
Indy's InputBuffer, ie:

    if( IdTCPClient1->ReadFromStack(true, 0, false) > 0 )
    {
        // pending data was read ...
    }


Gambit
Technical Details
Message-ID: <45e7333e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <45e6eac2$1@newsgroups.borland.com> <45e71374@newsgroups.borland.com> <45e717b9$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6320376fc8e5cd11
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <45e6eac2$1@newsgroups.borland.com> <45e71374@newsgroups.borland.com> <45e717b9$1@newsgroups.borland.com>
Subject: Re: About TIdTCPClient receive buffer...
Date: Thu, 1 Mar 2007 12:09:28 -0800
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <45e7333e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1172779838 75.83.34.171 (1 Mar 2007 12:10:38 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail