type TNode=^node;
node=record
flag:integer;
data:ShortString;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Fnode:=Allocmem(sizeof(Node));
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
client.Socket.SendBuf(Fnode^,Sizeof(node)) ;
end;
recv:
i:=socket.ReceiveLength ;
socket.ReceiveBuf(Anode^,i);//Anode同样要allocmem,free等等