lnet - onaccept and onconnect lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- daz · 2007-12-24 18:00 I was just wondering, how do I use those to determine if I connected and if I was accepted? If statements don't work ---------------------------------------------------------------------- Almindor · 2007-12-25 19:48 See the docs for complete explanation. These are events/callbacks. You assign functions to them which will get called when the things happen. eg: You have a form, and you add this procedure to it for OnConnect: Code: [Select] ... private:   function OnCo(Sender: TLSocket); end; ... implementation ... function TFormName.OnCo(Sender: TLSocket); begin   MessageDlg('Successfully connected'); end; If you assign this function to the Connection.OnConnect property like this (for example in FormCreate, or via object inspector): Code: [Select] Connection.OnConnect := @FormName.OnCo; you will get the OnCo function called sometime after you do Connection.Connect(host, port), if you connected successfully. Same with OnAccept, and all the other events of course. It's no different from Lazarus events (eg: button press) really...