Solved

Retrieve a stream

Posted on 2000-05-16
4
192 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Newbie Thread Programming 1 161
Delphi Mdi application Child forms get behind control 7 270
LAN or WAN ? 11 95
how to update exe applicatio from internet ? 6 87
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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