Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IP Public #14

Open
gaitolini opened this issue Feb 28, 2021 · 0 comments
Open

IP Public #14

gaitolini opened this issue Feb 28, 2021 · 0 comments

Comments

@gaitolini
Copy link

É Possível conectar o servidor com IP Public?

{ TMQTTServer }

procedure TMQTTServer.Activate (Enable: boolean);
var
i : integer;
begin
if FEnable = Enable then exit;
if (Enable) then
begin
Server.Banner := '';
Server.Addr := '0.0.0.0'; // IP Public? ***************************************
Server.Port := IntToStr (FPort);
Server.Proto := 'tcp';
Server.ClientClass := TClient;
try
Server.Listen;
FEnable := true;
except
FEnable := false;
end;
if FEnable then SetTimer (Timers, 3, 100, nil);
end
else
begin
FEnable := false;
for i := 0 to Server.ClientCount - 1 do
try
TClient (Server.Client[i]).Close;
except
end;
try
Server.Close;
except
end;
KillTimer (Timers, 1);
KillTimer (Timers, 2);
KillTimer (Timers, 3);
end;
if Assigned (FOnEnableChange) then
FOnEnableChange (Self);
end;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant