pjde / delphi-mqtt

MQTT server and client components for Delphi
147 stars 82 forks source link

IP Public #14

Open gaitolini opened 3 years ago

gaitolini commented 3 years ago

É 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;