Hi,
I'm using Delphi Tokyo and RTC v9.
I wrote a Windows Service REST server using RTC that works at home, but not at my customer's lol.
Well, this is my code for setting up the server:
procedure TRestServer.DoConfigRESTServer;
begin
FRestServer.ServerAddr := '';
FRestServer.ServerPort := Port.ToString ; //## Setting loaded from INI
FRestServer.MultiThreaded := True;
FRestServer.RestartOn.ListenLost := True;
end;
function TRestServer.DoConnect: Boolean;
begin
DoConfigRESTServer;
FRestServer.Listen;
result := True;
end;
The server is using port 8083. I have created in the same project group, two projects:
- Test Server (Simple form with a Start/Stop server button)
- The Service.
Both are sharing the class class that declares and assigns rtchttpServer using the code I show above.
In my office, when I run netstat -ano both the test server and the service displays correctly the port beeing used (running one at a time of course). For example:
TCP 0.0.0.0:8083 0.0.0.0:0 LISTENING 7272
My customer's has a Google VM machine hosted in google cloud. When I run the Test server, netstat displays what's expected. But when I install and start the service another port is used (
)
When the Service is running netstat displays:
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 612
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 1812
TCP 0.0.0.0:5986 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:10088 0.0.0.0:0 LISTENING 1556
TCP 0.0.0.0:16000 0.0.0.0:0 LISTENING 1556
TCP 0.0.0.0:17000 0.0.0.0:0 LISTENING 1556
TCP 0.0.0.0:47001 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING 336
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING 704
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING 744
TCP 0.0.0.0:49158 0.0.0.0:0 LISTENING 432
TCP 0.0.0.0:49162 0.0.0.0:0 LISTENING 440
TCP 0.0.0.0:49217 0.0.0.0:0 LISTENING 1868
TCP 10.142.0.2:139 0.0.0.0:0 LISTENING 4
TCP 10.142.0.2:3389 186.203.1.225:52459 ESTABLISHED 1812
TCP 10.142.0.2:16000 10.142.0.2:49275 ESTABLISHED 1556
TCP 10.142.0.2:16000 10.142.0.2:49276 ESTABLISHED 1556
TCP 10.142.0.2:49157 169.254.169.254:80 ESTABLISHED 1124
TCP 10.142.0.2:49275 10.142.0.2:16000 ESTABLISHED 2764 (*)
TCP 10.142.0.2:49276 10.142.0.2:16000 ESTABLISHED 2764 (*)
TCP [::]:135 [::]:0 LISTENING 612
TCP [::]:445 [::]:0 LISTENING 4
TCP [::]:3389 [::]:0 LISTENING 1812
TCP [::]:5986 [::]:0 LISTENING 4
TCP [::]:47001 [::]:0 LISTENING 4
TCP [::]:49152 [::]:0 LISTENING 336
TCP [::]:49153 [::]:0 LISTENING 704
TCP [::]:49154 [::]:0 LISTENING 744
TCP [::]:49158 [::]:0 LISTENING 432
TCP [::]:49162 [::]:0 LISTENING 440
TCP [::]:49217 [::]:0 LISTENING 1868
(PID is 2764)
When Test server is running (Form with buttons) netstat displays:
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 612
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 1812
TCP 0.0.0.0:5986 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:8083 0.0.0.0:0 LISTENING 1588 (*)
TCP 0.0.0.0:10088 0.0.0.0:0 LISTENING 1556
TCP 0.0.0.0:16000 0.0.0.0:0 LISTENING 1556
TCP 0.0.0.0:17000 0.0.0.0:0 LISTENING 1556
TCP 0.0.0.0:47001 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING 336
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING 704
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING 744
TCP 0.0.0.0:49158 0.0.0.0:0 LISTENING 432
TCP 0.0.0.0:49162 0.0.0.0:0 LISTENING 440
TCP 0.0.0.0:49217 0.0.0.0:0 LISTENING 1868
TCP 10.142.0.2:139 0.0.0.0:0 LISTENING 4
TCP 10.142.0.2:3389 186.203.1.225:52459 ESTABLISHED 1812
TCP 10.142.0.2:16000 10.142.0.2:49274 ESTABLISHED 1556
TCP 10.142.0.2:49157 169.254.169.254:80 ESTABLISHED 1124
TCP 10.142.0.2:49274 10.142.0.2:16000 ESTABLISHED 1588
TCP [::]:135 [::]:0 LISTENING 612
TCP [::]:445 [::]:0 LISTENING 4
TCP [::]:3389 [::]:0 LISTENING 1812
TCP [::]:5986 [::]:0 LISTENING 4
TCP [::]:47001 [::]:0 LISTENING 4
TCP [::]:49152 [::]:0 LISTENING 336
TCP [::]:49153 [::]:0 LISTENING 704
TCP [::]:49154 [::]:0 LISTENING 744
TCP [::]:49158 [::]:0 LISTENING 432
TCP [::]:49162 [::]:0 LISTENING 440
TCP [::]:49217 [::]:0 LISTENING 1868
What happened to my 8083 port?
What am I missing?
TIA,
Clément