P
philips330
Unregistered / Unconfirmed
GUEST, unregistred user!
麻烦大家看看下面的程序:
type
RecvInfo = record
nLen : integer;
data : TStream;
end;
var
UDPQueue : TQueue;
UDPRecord : ^RecvInfo;
procedure TMainForm.FormCreate(Sender: TObject);
begin
UDPQueue := TQueue.Create;
UDPServer.DefaultPort := 8090;
UDPServer.Active := true;
end;
procedure TMainForm.UDPServerUDPRead(Sender: TObject;
AData: TStream;
ABinding: TIdSocketHandle);
begin
AData.Seek(0,0);
New(UDPRecord);
UDPRecord^.nLen := AData.Size;
UDPRecord^.data.CopyFrom(AData,AData.Size);
UDPQueue.Push(UDPRecord);
end;
每当运行到 UDPRecord^.data.CopyFrom(AData,AData.Size);的时候就报错
type
RecvInfo = record
nLen : integer;
data : TStream;
end;
var
UDPQueue : TQueue;
UDPRecord : ^RecvInfo;
procedure TMainForm.FormCreate(Sender: TObject);
begin
UDPQueue := TQueue.Create;
UDPServer.DefaultPort := 8090;
UDPServer.Active := true;
end;
procedure TMainForm.UDPServerUDPRead(Sender: TObject;
AData: TStream;
ABinding: TIdSocketHandle);
begin
AData.Seek(0,0);
New(UDPRecord);
UDPRecord^.nLen := AData.Size;
UDPRecord^.data.CopyFrom(AData,AData.Size);
UDPQueue.Push(UDPRecord);
end;
每当运行到 UDPRecord^.data.CopyFrom(AData,AData.Size);的时候就报错