procedure TForm1.TcpServer1Accept(sender: TObject;
ClientSocket: TCustomIpClient);
var
s:
string;
nick:
string;
DataThread: TClientDataThread;
begin
// create thread
DataThread:= TClientDataThread.Create(true);
// set the TagetList to the gui list that you
// with to synch with.
DataThread.TargetList := memRecv.lines;
// Load the Threads ListBuffer
nick := ClientSocket.Receiveln;
DataThread.ListBuffer.Add( nick + '
; ' + ClientSocket.RemoteHost + '
> ');
s := ClientSocket.Receiveln;
while s <> '
'
do
begin
DataThread.ListBuffer.Add(s);
s := ClientSocket.Receiveln;
DataThread.ListBuffer.Add('
-Ende Nachricht-');
DataThread.ListBuffer.Add('
');
end;
// Call Resume which will execute and synch the
// ListBuffer with the TargetList
DataThread.Resume;
ScrollMemoDown(Memrecv)
end;