MOGSY Posted February 14, 2021 Share Posted February 14, 2021 Hi My standalone app works on localhost, however when running with HyperServer it fails with error message "Could not bind socket". Attached are the log files. I have updated the UniGUi to the latest version "uniGUI - v1.90.0.1545". What could be the reason? Regards A2021-02-14.log A2021-02-14.log A2021-02-14.log A2021-02-14.log Quote Link to comment Share on other sites More sharing options...
andyhill Posted February 15, 2021 Share Posted February 15, 2021 The IP or Port is already in use -or- the IP does not exist. UniGUI uses default settings for IP and Port unless you override them. I use the following:- procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject); ... AddNewBindingsFlag:= ? HttpPort:= ? BindToIpStr:= ? SslPort:= ? SslPassword:= ? ////////////////////////////////////////////////////////////////////////////// if AddNewBindingsFlag = True then begin Bindings.BeginUpdate; // Remove Any IDE Bindings Bindings.Clear; // Add binding for http with Bindings.Add do begin IP:= ''; Port:= 0; end; Bindings.EndUpdate; // Set http binding/port if UniServerModule.Bindings.Count > 0 then begin // Set Binding [0] http UniServerModule.Bindings.Items[0].Port:= HttpPort; UniServerModule.Bindings.Items[0].IP:= BindToIpStr; UniServerModule.Bindings.Items[0].BroadcastEnabled:= True; end else begin UniServerModule.Port:= HttpPort; end; ////////////////////////////////////////////////////////////////////////////// if UseSslFlag = True then begin SSL.SSLBindings.BeginUpdate; // Remove Any IDE Bindings SSL.SSLBindings.Clear; // Add binding for https with SSL.SSLBindings.Add do begin IP:= ''; Port:= 0; end; SSL.SSLBindings.EndUpdate; // Set https binding/port if UniServerModule.SSL.SSLBindings.Count > 0 then begin // Set Binding [0] https UniServerModule.SSL.SSLBindings.Items[0].Port:= SslPort; UniServerModule.SSL.SSLBindings.Items[0].IP:= BindToIpStr; UniServerModule.SSL.SSLBindings.Items[0].BroadcastEnabled:= True; end else begin UniServerModule.SSL.SSLPort:= 0; end; // Assign Certificate SSL.SSLOptions.RootCertFile:= UniServerModule.StartPath + 'root.pem'; SSL.SSLOptions.CertFile:= UniServerModule.StartPath + 'cert.pem'; SSL.SSLOptions.KeyFile:= UniServerModule.StartPath + 'key.pem'; SSL.SSLPassword:= SslPassword; SSL.Enabled:= True; end; // UseSslFlag end; // AddNewBindingsFlag Quote Link to comment Share on other sites More sharing options...
MOGSY Posted February 15, 2021 Author Share Posted February 15, 2021 Thank you Andy, I have tried your code, however it is the same. The standalone exe works fine it is when run with hyperserver is not running. Regards Quote Link to comment Share on other sites More sharing options...
andyhill Posted February 16, 2021 Share Posted February 16, 2021 This is a question for Farshad. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.