I do not want to close the connection, and not destroy it, must leave all
connected clients and access them when needed to send data and information,
I do not need to use Cliente.Free? it will not overload the memory?

thanks again!

2014-10-07 11:31 GMT-03:00 Wilfried Mestdagh <wilfr...@mestdagh.biz>:

> >       Cliente.Free;
>
> You destroy a client managed by TWSocketServer. If you have the intention
> to close the connection just call: Cliente.CloseDelayed; After the client
> close it will be destroyed by the managing TWSocketServer.
>
> --
> mvg, Wilfried
> http://www.mestdagh.biz
> http://www.comfortsoftware.be
> http://www.expertsoftware.be
>
>
> > -----Oorspronkelijk bericht-----
> > Van: TWSocket [mailto:twsocket-boun...@lists.elists.org] Namens
> > {Dark_Ducke}
> > Verzonden: dinsdag 7 oktober 2014 15:35
> > Aan: ICS support mailing
> > Onderwerp: [twsocket] TWSocketServer listen connections
> >
> > Hello, I created a server tcp / ip to receive multiple simultaneous
> > client
> > connections, so far so good it seems to be working properly, I need to
> > get
> > more information of these connected clients, list them, do some action
> > etc.
> > .. I am doing as follows
> >
> > on ConnectionDataAvailable;
> > Command: = ReceiveStr;
> > process information ...
> >
> > now created a function to list the clients:
> >
> >    SGCons.RowCount := WSocketServer1.ClientCount + 1;
> >    for Count := 0 to WSocketServer1.ClientCount - 1 do
> >      begin
> >       Cliente := TClientConnection(WSocketServer1.Client[Count]);
> >
> >       SGCons.Cells[0, Count+1] := IntToStr(Count + 1) + 'ยบ';
> >       SGCons.Cells[1, Count+1] := Cliente.PeerAddr;
> >       SGCons.Cells[2, Count+1] := DateTimeToStr(Cliente.ConnectTime);
> >       SGCons.Cells[3, Count+1] := DateTimeToStr(Cliente.LastAction);
> >       SGCons.Cells[4, Count+1] := IntToStr(Cliente.CliId);
> >
> >       Cliente.Free;
> >      end;
> >
> >
> > it takes the information normally only if I do the 2x
> > WSocketServer1.ClientCount property comes zeroed after passing through
> > Cliente.Free; it seems that closes the connection,'re correct that?
> > need to
> > receive multiple connections and keep them active and list them ..
> >
> >
> >
> >   { TClientConnection is used to handle client connections }
> >   TClientConnection = class(TWSocketClient)
> >   protected
> >       FRcvdLine : String;         { Buffer for commands              }
> >       FIndex    : Integer;        { Slot number as known by server   }
> >       ConnectTime  : TDateTime;
> >       LastAction  : TDateTime;
> >       procedure ConnectionDataAvailable(Sender: TObject; Error : Word);
> >   public
> >       constructor Create(AOwner : TComponent); override;
> >   end;
> > --
> > To unsubscribe or change your settings for TWSocket mailing list
> > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> > Visit our website at http://www.overbyte.be
>
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to