Jump to content
TurboMagic

DataSnap doesn't create server port

Recommended Posts

Hello,

 

this is the same issue as the one described in the German DP (https://www.delphipraxis.net/215286-port-nicht-erzeugt-2.html),
but there I don't get any further ideas. So I hope somebody here can help me.

 

I have some application written in Delphi 10.3.3 which provides two endpoints and has worked in the past.
One endpoint delivers a simplistic status website and the other can be used to query data via REST.

 

For both the user can configure the port and whether to use HTTPS or not. If HTTPS is used a self signed certivicate is used
and the application provides V1.0.2j of the OpenSSL libraries.

 

Now I have the reproduceable case that the port for the REST interface is never created (says netstat -p TCP on the cmd.exe console)
and the one for the status website some times is but most of the times isn't.

 

The code for creating both DataSnap server instances is identical and looks like this:
 

  if FMyServiceEnabled and (not FRESTServer.Active) then
  begin
    FRESTServer.Bindings.Clear;
    FRESTServer.DefaultPort := FMyServicePort;
    FRESTServer.Active := True;

    log.Send(LevelBlue, cCategory, 'REST Server gestartet. Port: ' + FMyServicePort.ToString);
  end;

  if FStatusWebsite and (not FWebServer.Active) then
  begin
    FWebServer.Bindings.Clear;
    FWebServer.DefaultPort := FStatusPort;
    FWebServer.Active := True;

    log.Send(LevelBlue, cCategory, 'Web Server gestartet. Port: ' + FStatusPort.ToString);
  end; 

When looking into the logs generated, they show that this code was actually run.
The issue happens on a customers PC and on my own machine as well.

 

With another tool suggested by somebody in German DP (writing in EN 😉 ) I was able to see that both bind ahnd listen are called on the socket.
But netstat doesn't show it...

What can cause this and how to further diagnose this? Esp. what data snap does?

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

×