🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TServerSocket -> WebPage

#5520
From: Colin B Maharaj
Date: Wed, 18 Aug 2004 03:43
26 lines
1778 bytes
You probably need to disconnect the connection, from the server end, 
after you send all the data to the client....
e.g. Socket->Disconnect();


Jo�o Pereira wrote:
> How can i automatic send a image to a web page. Per example inserting my
> remote IP in the address bar of IE and automaticly loads a image that is on
> the other side.
> 
> I've tryed this code:
> 
> void __fastcall TForm1::MyServerClientRead(TObject *Sender,
>       TCustomWinSocket *Socket)
> {
>         TMemoryStream *MyStream = new TMemoryStream();
>         MyStream->LoadFromFile("c:\\imagem.jpg");
>         Socket->SendStream(MyStream);
> 
> }
> 
> but in IE the image just loads about 90% and i gotta press stop to see the
> image. Seems like i got to send the stream size, but how can i do that?
> 
> 
> 
Technical Details
Message-ID: <4122d06f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4110d343$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,17d6b73752afed17
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII
Date: Tue, 17 Aug 2004 23:43:41 -0400
From: Colin B Maharaj <noreply@myhost.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7a) Gecko/20040219
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: TServerSocket -> WebPage 
References: <4110d343$1@newsgroups.borland.com>
In-Reply-To: <4110d343$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 200.108.15.127
Message-ID: <4122d06f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1092800623 200.108.15.127 (17 Aug 2004 20:43:43 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail