内存操作不是很简单吗?
type
TData = record
info: array [0..255] of char;
size: integer;
end;
getmem(data, 1024 + sizeof(TData));
PData(Data)^.Info := 'abcd';
PData(Data)^.size := 1024 + sizeof(TData);
system.move(buffer^, Pointer(Integer(Data)+sizeof(TData))^, 1024);
socket1.sendbuf(Data^, 1024 + sizeof(TData));
var
P: TData;
begin
socket.recivebuf(@p.info[0], sizeof(p.info));
socket.recivebuf(p.size, sizeof(integer));
getmem(Buffer, p.size);
socket.recivebuf(buffer^, p.size);