kabiri 3 Posted May 23, 2019 (edited) I install ICS8.6.1 but TWSocketThrdServer missing in FMX Edited May 23, 2019 by kabiri Share this post Link to post
Angus Robertson 577 Posted May 23, 2019 Sorry, TWSocketThrdServer has never been supported by FMX, nor has it really been updated for a decade or more. It is probably little effort to add FMX support, but it is not often used since most ICS servers work fine without threads, It's only when you need several hundred simultaneous clients that threads become necessary, and then perhaps not one per client. Angus 1 Share this post Link to post
kabiri 3 Posted May 23, 2019 I migrate from VCL to FMX and replace TWSocketThrdServer with TWSocketServer but clicent can not connect TMyClient = class(TWSocketClient) public RcvdLine : AnsiString; ConnectTime : TDateTime; end; ... WSocketServer1.Proto := 'tcp'; { Use TCP protocol } WSocketServer1.Port := '8085'; { Use telnet port } WSocketServer1.Addr := '0.0.0.0'; { Use any interface } WSocketServer1.ClientClass := TMyClient; { Use our component } WSocketServer1.Listen; { Start listening } procedure TfrmDataModule.WSocketServer1ClientCreate(Sender: TObject; Client: TWSocketClient); var Cli : TMyClient; begin Cli := Client as TMyClient; Cli.OnDataAvailable := ClientDataAvailable; Cli.OnLineLimitExceeded := ClientLineLimitExceeded; Cli.OnBgException := ClientBgException; Cli.ConnectTime := Now; end; procedure TfrmDataModule.WSocketServer1ClientConnect(Sender: TObject; Client: TWSocketClient; Error: Word); begin with Client as TMyClient do begin //Client.LineMode := TRUE; //Client.LineEdit := TRUE; //Client.LineLimit := 255; { Do not accept long lines } Client.OnDataAvailable := ClientDataAvailable; Client.OnLineLimitExceeded := ClientLineLimitExceeded; Client.OnBgException := ClientBgException; TMyClient(Client).ConnectTime := Now; end; end; Share this post Link to post
Angus Robertson 577 Posted May 23, 2019 Sorry the limit of our FMX support is ensuring the components build and install as FMX libraries, and even that takes a lot of my precious unpaid time. The FMX samples have not been updated for several years. I personally only use VCL so am unable to devote any more time to FMX support, The developer that did all the cross platform and FMX work passed some years ago, and no-one has replaced him. Angus 1 Share this post Link to post