FNCCloudStorageServices

Hi
We have been using the FNCCloudServices quite successfully for a while. However some of our customers are experiencing an issue with it and we think we have identified why.

Some of our customers run our application in an RDP environment, running multiple instances of our application on the same server. When multiple users try to use the cloud storage services at the same time they get a 'could not bind socket' error. Is it possible to set a range of ports to use if an existing port is already in use so that this error can be avoided please?

Thanks

It's not possible to specify a list of ports. This logic will have to be implemented manually. The code to check if a port is open could be implemented and used before connecting to the service. And each port that can be used needs to be registered in the cloud service console.

Hi Pieter, thanks for your reply. I'm deducing then that the error is created in setting up the callback. If the process of authentication completes successfully the port is released? What is the timeout for failure? Can this timeout be adjusted?

When the authenticate result is parsed, the server is being set inactive. The default timeout is 60 seconds. You can configure the HTTPServer via this code:


procedure TForm1.DoHTTPServerConnect(AContext: TIdContext);
begin
  AContext.Connection.Socket.ReadTimeout := 60000;
end;

procedure TForm1.DoConfigureHTTPServer(Sender: TObject;
  const AHTTPServer: THTTPServer);
begin
  AHTTPServer.OnConnect := DoHTTPServerConnect;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFNCCloudStorageServices1.Storage.OnConfigureHTTPServer := DoConfigureHTTPServer;
end;