T
totogirl
Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是静态数组,
var
Bufferread:array[0..60000] of byte;
Stream:TWinSocketStream;
.....
begin
.....
while ClientSocket1.Active do
begin
Try
Stream:=TWinSocketStream.Create(ClientSocket1.Socket,60000);
try
FillChar(Bufferread,60000,0);
........
If Stream.WaitForData(20000) then
begin
If Stream.Read(Bufferread,60000)=0 then
begin
ClientSocket1.Close;
end;
但是,这之后大概从Bufferread[3760]开始,以后都是空值了,
而Bufferread[3760]之前的数据都正确,why???
我试着调整了Bufferread:array[0..60000] of byte;的大小,错误一点都没变,
试着调整了Stream.WaitForData(20000) 的时间值也不行,
如果用动态数组,那么初始化时 FillChar(Bufferread,60000,0);是不是会出错??
我的程序错哪了??
另外,Bufferread[3760]之后肯定是有数据的,可收不到.
但对方过来的第一个数据包是10000byte左右.
var
Bufferread:array[0..60000] of byte;
Stream:TWinSocketStream;
.....
begin
.....
while ClientSocket1.Active do
begin
Try
Stream:=TWinSocketStream.Create(ClientSocket1.Socket,60000);
try
FillChar(Bufferread,60000,0);
........
If Stream.WaitForData(20000) then
begin
If Stream.Read(Bufferread,60000)=0 then
begin
ClientSocket1.Close;
end;
但是,这之后大概从Bufferread[3760]开始,以后都是空值了,
而Bufferread[3760]之前的数据都正确,why???
我试着调整了Bufferread:array[0..60000] of byte;的大小,错误一点都没变,
试着调整了Stream.WaitForData(20000) 的时间值也不行,
如果用动态数组,那么初始化时 FillChar(Bufferread,60000,0);是不是会出错??
我的程序错哪了??
另外,Bufferread[3760]之后肯定是有数据的,可收不到.
但对方过来的第一个数据包是10000byte左右.