Nachricht ist einfach ne Chat-Nachricht:
Delphi-Quellcode:
var i,j,k: integer;
dummy: string;
Nachricht: TChatNachricht;
Die Empfangsroutine ist:
Delphi-Quellcode:
procedure TFrmClient.ClientSocketRead (Sender: TObject; Socket: TCustomWinSocket);
var Nachricht: TChatNachricht;
strIn, strText: String;
rand: integer;
begin
Socket.ReceiveBuf (Nachricht, SizeOf(Nachricht));
mess:=Nachricht.text;
if mess[1]+mess[2]+mess[3]+mess[4]='#$$#' then begin
if mess[5]+mess[6] ='AO' then begin
command:=mess;
Commandinterpret (FrmClient, ClientSocket.Socket);
end;
...
if command[1]+command[2]+command[3]+command[4]+command[5]+command[6]='#$$#AO' then begin
command[1]:=' ';
command[2]:=' ';
command[3]:=' ';
command[4]:=' ';
command[5]:=' ';
command[6]:=' ';
idpointer:=StrToInt(command[7]+command[8]+command[9]);
filename:=command[7]+command[8]+command[9];
loc:=StrToInt(command[10]+command[11]);
command[7]:=' ';
command[8]:=' ';
command[9]:=' ';
command[10]:=' ';
command[11]:=' ';
command:=trim(command);
objectarray[idpointer,loc]:=command;
end;
Wie gesagt unter XP alles kein Problem.