David,
Hi. Is there any reason why you cannot use a web server for this? If IIS is not your cup of tea then try WebSite. In any case, if you must reinvent the wheel, I would strongly suggest you use one of the 3rd party TCP/IP libraries, such as IMS (Internet Mail Suite).
The other thought is when do you close the socket? Bear in mind that the sockets are buffered, so the SendStream call may return before all data is sent. If you then try to close the socket, it may abort the data stream (depends on socket settings). The other thing to note is after call ing SendStream, the stream object belongs to the socket - you should not free the stream. What does SendStream return?
Hope this helps,
Dennis.
> I have a little app which is supposed to feed an image to a browser.
> The image is on disk, the browser connects through a TServerSocket.
>
> <img src="http://150.1.1.43:16384">
>
> MyStream := TFileStream.Create(FileName, 0) ;
> Socket.SendStream(MyStream) ;
>
> This all works fine until the image gets to a certain size.
> The Image on disk is fine, the streamed image gets truncated after about
> 10240 bytes.
>
> I have tried to break the stream up and send it in small chunks, but then
> the browser seems to get nothing.
>
> Any ideas how I am supposed to be doing this?