Board index » delphi » udp server to stream video

udp server to stream video

How does one stream out large files from the server to teh client?
I have been able to send and receive a small text file with this code -

From UDPServer
  vFileName := 'f:\downloads\custdata.txt';
  vfile := TFileStream.Create(vFileName,fmOpenRead);
  ABinding.Send(vbuffer,vfile.size,MSG_OOB);

To UDPClient
  UDPClient.ReceiveBuffer(vbuffer,vfile.size);
  vtest.WriteBuffer(vbuffer,vfile.size);

However to send larger streams, I need to break up the buffer into smaller
segments otherwise I get a stack overflow.
I am not sure how to do this - the following code did not work.

UDPServer
for i := 0 to 4 do
  begin
    vfile.Read(vBuffer,4000);
    ABinding.Send(vbuffer,40000,MSG_OOB);
  end;

Any suggestions appreciated

Gerald

 

Re:udp server to stream video


Quote
"Gerald Morris" <g...@dataforcesoftware.com> wrote in message

news:3ee65c41$1@newsgroups.borland.com...

Quote
>     vfile.Read(vBuffer,4000);
>     ABinding.Send(vbuffer,40000,MSG_OOB);

Look very closely.  You are reading 4000 bytes but then trying to transmit
40,000 instead.  Remove one of the zeros.

Gambit

Other Threads