ho consultato anche quella, ma proprio non ho capito che devo fare...
Ho scritto questo:
Clicco su ServerStart e su ClientStart per avviare i rispettivi componenti, poi cliccando su ClientSend dovrebbe mandare 'ciao' al server, che nell'evento Execute, dovrebbe scriverlo in un TMemo (ServerLog). Ma questo non succede!!!! la connessione avviene correttamente, ma non scrive niente nel ServerLog! Perchè!?!?!?!?!codice:procedure TForm1.ClientSendClick(Sender: TObject); begin TCPClient.IOHandler.WriteBufferOpen; TCPClient.IOHandler.WriteLn('ciao'); TCPClient.IOHandler.WriteBufferFlush; TCPClient.IOHandler.WriteBufferClose; end; procedure TForm1.ClientStartClick(Sender: TObject); begin TCPClient.Connect(IP.CurrentIP,1661); end; procedure TForm1.ServerStartClick(Sender: TObject); begin TCPServer.Active := true; end; procedure TForm1.TCPServerExecute(AContext: TIdContext); begin ServerLog.Lines.Add(AContext.Connection.IOHandler.ReadLn); end; procedure TForm1.Timer1Timer(Sender: TObject); begin if TCPClient.Connected then Label1.Caption := 'Connessione stabilita.' else Label1.Caption := 'Connessione assente.'; end; end.

Rispondi quotando