Home > Back-end >  Delphi after encapsulation SendText Clientsocket method must showmessage before the client receives
Delphi after encapsulation SendText Clientsocket method must showmessage before the client receives

Time:09-26

Try
Application CreateForm (TForm1 Form1);
Sockets:=TClientSocket. Create (Application);
Socket. Port:=Port;
Socket. OnConnect:=Form1. ClientSocket1. OnConnect;
Socket. one rror:=Form1. ClientSocket1. one rror;
Socket. The Active:=False;
Socket. Host:=ServerIp;
Socket. The Active:=true;
Socket. Socket. SendText (Msg);

ShowMessage (' 1 ');

The finally
Socket. Free;
//socket:=nil;
Form1. Free;

end;
 
  • Related