Article View: borland.public.cppbuilder.internet.socket
Article #3172Re: TServerSocket Not Receiving Data
From: Hans Galema
Date: Mon, 14 Nov 2005 22:23
Date: Mon, 14 Nov 2005 22:23
56 lines
2565 bytes
2565 bytes
Bill Cain wrote:
> I am writing an FTP client application that uses TServerSocket(as the
> data connection) in a thread other than the main VCL thread.
Do you use TClientSocket for the client part ?
> The
> ServerType is set to stBlockingThread.
stThreadBlocking ?
> The problem that I am encountering is that the socket does not appear to
> be accepting data received from a client after connecting to the client.
Sorry. Servers do not connect to clients. A server can only listen and wait
for connections.
> Accept and Connection Events are triggered but no Read Event is triggered.
The OnRead event will never be triggered with stThreadBlocking. You have
to actively read from a stream.
> Can you tell me why the TServerSocket is not receiving data?
You did not show code where you tried to read from a stream.
> DataSocket2->Port = ConvertPortString(PortString);
Pleae supply types. Is DataSocket2 a TServerSocket ? If yes why do
you need 2 ?
> Command = AnsiString("PORT ") + AnsiString(Addr[0]) +\
> AnsiString(",") + AnsiString(Addr[1]) +\
> AnsiString(",") + AnsiString(Addr[2]) +\
> AnsiString(",") + AnsiString(Addr[3]) + PortString;
We cannot check here the contents of Addr.
> if(Error = DoTransaction(Command))
> {
> return Error;
> }
We cannot check how you implemented DoTransaction.
> Writeln(AnsiString("NLST"));//List item names
Ditto.
> while(Wait) //Wait for LIST responses
> {
> }
What is Wait ?
Hans.
Technical Details
Message-ID:
<43790e73$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4378d734$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,ed98f643ba2c61e4 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 14 Nov 2005 23:23:00 +0100 From: Hans Galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: TServerSocket Not Receiving Data References: <4378d734$1@newsgroups.borland.com> In-Reply-To: <4378d734$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 145.98.201.248 Message-ID: <43790e73$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1132007027 145.98.201.248 (14 Nov 2005 14:23:47 -0700) Lines: 56 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail