You are not logged in.
Pages: 1
During the installation the Setup program runs exe, which registers the ports in http.sys
After that, the client connects to the server (Server - windows service) via network and all works fine.
After the system restart, the same client connects to the server again and this time it takes toooooo much time to connect. The execution of several methods takes more than a minute.
HttpSysManager.exe shows that the ports are registered.
(
http://+:50888/wps/
http://+:50888/wp/
http://+:50999/svc/
)
If the server and client are installed on the local computer, no problem occurs.
When using http.sys API v.1 the problem does not exist.
The code which is called with the Administrator execution rights during the installation:
ini := TIniFile.Create(DefaultWorkPlace + 'port.ini');
try
port := ini.ReadString('main','port', '50888');
svcport := ini.ReadString('svc', 'port', '50999');
ssl := ini.ReadInteger('main','ssl', 1);
finally
ini.Free;
end;
delete := SameText(ParamStr(1),'/DELETE');
// parameters below must match class function
// TTestClientServerAccess.RegisterAddUrl in mORMotHttpServer.pas:
writeln(REGSTR[delete],' of /wps:' + port + ' for http.sys');
writeln(REGSTR[delete],' of /wp:' + port + ' for http.sys');
writeln(REGSTR[delete],' of /svc:' + svcport + ' for http.sys');
writeln(THttpApiServer.AddUrlAuthorize('wps',port, ssl=2, '+',delete));
writeln(THttpApiServer.AddUrlAuthorize('wp',port, ssl=2, '+',delete));
writeln(THttpApiServer.AddUrlAuthorize('svc',svcport, ssl=2, '+',delete));
AddApplicationToFirewall('Delivery Server', ExtractFilePath(ParamStr(0)) + 'xxxx.exe');
AddApplicationToFirewall('Delivery Controller', ExtractFilePath(ParamStr(0)) + 'yyyy.exe');
AddPortToFirewall('Delivery Server Port', StrToIntDef(Port, 50888));
AddPortToFirewall('Delivery Controller Port', StrToIntDef(svcport, 50999));
Creating HTTP server in server application:
try
HttpServer := TRootWebServer.Create(port, [WPlaceServer], '+', useHttpApi, 32, SSL); // 32
except
on e : exception do
raise Exception.Create('Port: '+ port + ' in use');
end;
HttpServer.AccessControlAllowOrigin := '*';
....
HttpServer.AddServer(FSettingsServer, nil, ssl);
HttpServer.AddServer(FGroupServer, nil, ssl);
HttpServer.AddServer(FBounceServer, nil, ssl);
...
Offline
Yes, I'm using version from 01 apr.
Without adding port to the firewall, I did not get to connect to the server. I tried it on windows 8 and windows server 2012
Offline
The problem is that calling the Http.CreateRequestQueue function gives the error:
HttpCreateRequestQueue failed: Cannot create a file when that file already exists (183)
It seems the problem is in the generation of the name for CreateRequestQueue.
I added logging:
constructor THttpApiServer.Create(CreateSuspended: Boolean);
var bindInfo: HTTP_BINDING_INFO;
...
LogToTextFile('fServerSessionID:= ' + Int64ToUtf8(fServerSessionID));
LogToTextFile('fServerSessionID_BIN:= ' + BinToHexDisplayW(@fServerSessionID,SizeOf(fServerSessionID)));
LogToTextFile('fServerSessionID_UIN:= ' + UIntToStr(fServerSessionID));
LogToTextFile('fServerSessionID_IntToHex:= ' + IntToHex(fServerSessionID, 16));
EHttpApiServer.RaiseOnError(hCreateRequestQueue,Http.CreateRequestQueue(
Http.Version,pointer(BinToHexDisplayW(@fServerSessionID,SizeOf(fServerSessionID))),
nil,0,fReqQueue));
and saw that BinToHexDisplayW often returns the name for RequestQueue, which already exists in the system.
Probably IntToHex or as mpv suggested UIntToStr is a better choice for the name generation?
As you see BinToHexDisplayW and IntToHex give different results for the same fServerSessionID:
2014-04-08 15:29:38 fServerSessionID:= -72057576321187757
2014-04-08 15:29:38 fServerSessionID_BIN:= FF00000022000055
2014-04-08 15:29:38 fServerSessionID_UIN:= 18374686497388363859
2014-04-08 15:29:38 fServerSessionID_IntToHex:= FF00000420000053
Offline
There was indeed an issue!
We just fixed the BinToHexDisplayW() function.
See http://synopse.info/fossil/info/067be43817
Should work as expected now.
Thanks for the feedback.
Offline
Pages: 1