Board index » delphi » About "PowerSocket" reading ?

About "PowerSocket" reading ?

Refer to following:

..
MyStream := TMemoryStream.Create;
try
    Powersock1.CaptureStream(MyStream, 256);

    SetLength(S, MyStream.Size);
    MyStream.Write(S, MyStream.Size);

    Memo1.Text := S;
finally
    MyStream.Free;
end;
..

Well, a big problem: If "MyStream" can not read 256 bytes once (suppose
 remote site provides only 250 bytes), will it wait...until all 256
 bytes are readin ? (If it does, how to avoid this situation ?)

 

Re:About "PowerSocket" reading ?


Refer to following:

..
MyStream := TMemoryStream.Create;
try
    Powersock1.CaptureStream(MyStream, 256);

    SetLength(S, MyStream.Size);
    MyStream.Write(S, MyStream.Size);

    Memo1.Text := S;
finally
    MyStream.Free;
end;
..

Well, a big problem: If "MyStream" can not read 256 bytes once (suppose
 remote site provides only 250 bytes), will it wait...until all 256
 bytes are readin ? (If it does, how to avoid this situation ?)

Other Threads