Article View: borland.public.cppbuilder.internet.socket
Article #5096Re: How TServerSocket sends back data to TClientSocket... ?
From: Vladimir Stefanovic
Date: Fri, 15 Oct 2004 14:56
Date: Fri, 15 Oct 2004 14:56
40 lines
2125 bytes
2125 bytes
Hi,
I want just to inform you that I have succeded (with your
instructions) to send a request to server, handle it, and send
back to client some data. Thank you very much for help.
In fact I had a problem because I haven't placed the sending
code at the right place. From the code below the mistake was
obvious, but when you have several closing brackets one after
another (try,try,while) it's not _so_ obvious.
void __fastcall TLocalServerThread::ClientExecute()
{
// ...
while( ( !Terminated ) && ( ClientSocket->Connected ) )
{
// ... receives request
// This is the right place sending data
}
// MY SENDING CODE WAS HERE, WHICH IS WRONG
// ...
}
The reason I told you all this is because I noticed one weird
thing of TMemoryStream::SaveToFile() method (which I used
like some checkpoint to see what I received).
I placed TMemoryStream::SaveToFile() in the section that was
_wrong_. There were only 32 bytes that should be saved.
I noticed that the file size BEFORE I close the connection on
client is ~13MB, and after closing, the size was as expected -
32 bytes.
Funny...
Best regards,
Vladimir Stefanovic
Technical Details
Message-ID:
<416fe4e9@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<416e8327@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,5efe1ef2e1363462 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Stefanovic" <spam@not.needed> Newsgroups: borland.public.cppbuilder.internet.socket References: <416e8327@newsgroups.borland.com> Subject: Re: How TServerSocket sends back data to TClientSocket... ? Date: Fri, 15 Oct 2004 16:56:24 +0200 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: 213.137.116.217 Message-ID: <416fe4e9@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1097852137 213.137.116.217 (15 Oct 2004 07:55:37 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail