How to accept only 3 connections ? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- fafastrungen · 2011-06-29 17:19 Hi, I'm using lNet's tcp component and I need a way to allow only 3 connections. Right now I'm closing sockets inside the onAccept event, but I'd like something more secure. Thanks in advance. ---------------------------------------------------------------------- Almindor · 2011-06-30 07:45 If you want to stop accepting after N connections you should disconnect the server socket. I'm not sure if this will 100% work, honestly I've never tried. Try: Code: [Select]LNet.IterReset; Lnet.Iterator.Disconnect; After all 3 connections were accepted. I'll look into this possibility for 0.7.x ---------------------------------------------------------------------- fafastrungen · 2011-07-01 04:38 Thanks, but is there any way to use something like: "tpsocket.StopListening" or "tcpsocket.Stop" without disconnect the connected clients ? ---------------------------------------------------------------------- Almindor · 2011-07-01 10:19 Right now not AFAIK I'll look at it during the weekend.