blcksock.pas - int64 for counters and TStream support (by Pepak)
git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@226 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
parent
2efcf47e8a
commit
8f9d5b6aad
20
blcksock.pas
20
blcksock.pas
@ -312,8 +312,8 @@ type
|
|||||||
{$IFNDEF CIL}
|
{$IFNDEF CIL}
|
||||||
FFDSet: TFDSet;
|
FFDSet: TFDSet;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FRecvCounter: Integer;
|
FRecvCounter: int64;
|
||||||
FSendCounter: Integer;
|
FSendCounter: int64;
|
||||||
FSendMaxChunk: Integer;
|
FSendMaxChunk: Integer;
|
||||||
FStopFlag: Boolean;
|
FStopFlag: Boolean;
|
||||||
FNonblockSendTimeout: Integer;
|
FNonblockSendTimeout: Integer;
|
||||||
@ -546,7 +546,7 @@ type
|
|||||||
occured.)}
|
occured.)}
|
||||||
procedure RecvStreamRaw(const Stream: TStream; Timeout: Integer); virtual;
|
procedure RecvStreamRaw(const Stream: TStream; Timeout: Integer); virtual;
|
||||||
{:Read requested count of bytes from socket to stream.}
|
{:Read requested count of bytes from socket to stream.}
|
||||||
procedure RecvStreamSize(const Stream: TStream; Timeout: Integer; Size: Integer);
|
procedure RecvStreamSize(const Stream: TStream; Timeout: Integer; Size: int64);
|
||||||
|
|
||||||
{:Receive data to stream. It using @link(RecvBlock) method.}
|
{:Receive data to stream. It using @link(RecvBlock) method.}
|
||||||
procedure RecvStream(const Stream: TStream; Timeout: Integer); virtual;
|
procedure RecvStream(const Stream: TStream; Timeout: Integer); virtual;
|
||||||
@ -765,11 +765,11 @@ type
|
|||||||
|
|
||||||
{:Return count of received bytes on this socket from begin of current
|
{:Return count of received bytes on this socket from begin of current
|
||||||
connection.}
|
connection.}
|
||||||
property RecvCounter: Integer read FRecvCounter;
|
property RecvCounter: int64 read FRecvCounter;
|
||||||
|
|
||||||
{:Return count of sended bytes on this socket from begin of current
|
{:Return count of sended bytes on this socket from begin of current
|
||||||
connection.}
|
connection.}
|
||||||
property SendCounter: Integer read FSendCounter;
|
property SendCounter: int64 read FSendCounter;
|
||||||
published
|
published
|
||||||
{:Return descriptive string for given error code. This is class function.
|
{:Return descriptive string for given error code. This is class function.
|
||||||
You may call it without created object!}
|
You may call it without created object!}
|
||||||
@ -2508,15 +2508,16 @@ begin
|
|||||||
until FLastError <> 0;
|
until FLastError <> 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBlockSocket.RecvStreamSize(const Stream: TStream; Timeout: Integer; Size: Integer);
|
procedure TBlockSocket.RecvStreamSize(const Stream: TStream; Timeout: Integer; Size: int64);
|
||||||
var
|
var
|
||||||
s: AnsiString;
|
s: AnsiString;
|
||||||
n: integer;
|
n: int64;
|
||||||
{$IFDEF CIL}
|
{$IFDEF CIL}
|
||||||
buf: TMemory;
|
buf: TMemory;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
for n := 1 to (Size div FSendMaxChunk) do
|
n := Size div int64(FSendMaxChunk);
|
||||||
|
while n > 0 do
|
||||||
begin
|
begin
|
||||||
{$IFDEF CIL}
|
{$IFDEF CIL}
|
||||||
SetLength(buf, FSendMaxChunk);
|
SetLength(buf, FSendMaxChunk);
|
||||||
@ -2530,8 +2531,9 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
WriteStrToStream(Stream, s);
|
WriteStrToStream(Stream, s);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
dec(n);
|
||||||
end;
|
end;
|
||||||
n := Size mod FSendMaxChunk;
|
n := Size mod int64(FSendMaxChunk);
|
||||||
if n > 0 then
|
if n > 0 then
|
||||||
begin
|
begin
|
||||||
{$IFDEF CIL}
|
{$IFDEF CIL}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user