Solved

Retrieve a stream

Posted on 2000-05-16
4
184 Views
Last Modified: 2010-04-04
In the ClientSocket there's a method 'sendStream', but how can I retrieve the stream on the serverSocket???

This doesn't work :

//Client
procedure TForm2.ClientSocket1Connect(Sender: TObject;
  Socket: TCustomWinSocket);
var
  BinStream: TMemoryStream;
  strs:  TStrings;
begin
   strs := TStringlist.Create;

   strs.Add('test1');
   strs.Add('test2');
   strs.Add('test3');

   BinStream := TMemoryStream.Create;
   strs.SaveToStream(binstream);
   socket.SendStream(binstream);
   binstream.Free;
end;


//Server
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
  Socket: TCustomWinSocket);
begin
   listbox1.Items.Add(socket.ReceiveText);
end;

0
Comment
Question by:Smilly
4 Comments
 
LVL 3

Expert Comment

by:ckaneta
ID: 2815993
I would have to say, look at the ReceiveBuf method of the socket.
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2816204
listenning
check ICS demos
http://www.rtfm.be/fpiette/indexuk.htm
0
 
LVL 7

Accepted Solution

by:
God_Ares earned 20 total points
ID: 2818145
try this

pos := binstream.position;

strs.SaveToStream(binstream);

binstream.position := pos;

socket.SendStream(binstream);
   
also look at my little program

(filetransfer & zwembroek)
www.angelfire.com/ok/GODARES/downl.html


Have FUN

Greetz
0
 
LVL 1

Author Comment

by:Smilly
ID: 2847461
Comment accepted as answer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Memory leak using records in a TVirtualStringTree 11 109
IExtractImage Delphi 14 201
Syntax Check Delphi Seattle IOS app without MAC ? 1 91
Correct Component for Shopping Cart. 2 95
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now