Jump to content
kabiri

Missing TWSocketThrdServer

Recommended Posts

I install ICS8.6.1 but TWSocketThrdServer missing in FMX

Edited by kabiri

Share this post


Link to post

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

  • Thanks 1

Share this post


Link to post

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

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

 

  • Sad 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×