lNet: Disconnect after SendMessage lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- S-Man · 2014-08-27 16:38 Hi, i've a problem. I am using a TLTCPComponent named "Client". The code looks like: Code: [Select]procedure TForm1.Create(Sender: TObject); begin    Client.Connect(ServerIP, Port); //ServerIP and Port are given...    Client.SendMessage('SomeText'); end; The server application is getting the connection. Then it receives a '' string and receives a disconnect from the client. If I try following: Code: [Select]procedure TForm1.Create(Sender: TObject); begin    Client.Connect(ServerIP, Port); //ServerIP and Port are given... end; procedure TForm1.Button1Click(Sender: TObject); begin   Client.SendMessage('SomeText'); end; everything is alright. The server gets the connection from the client. And if I send text with the button the connection stays open. The problem is now: Why does the connection close if I send text right after the opening? Greets and thanks, S-Man ---------------------------------------------------------------------- S-Man · 2014-08-27 22:17 Got the solution: The SendMessage comes too fast. It has to called in OnConnect. Greets S-Man