i am creating a new topic with bugs reported with uploaded files, inside him is solutions.
http://www.rejetto.com/forum/index.php?topic=6842.0restricted bug with 'server start/stop'After some checks of last minute, it seems, that only the use of 'runeventscript('server start/stop')', raises problems
In the compilation, it was not the good procedure which was called, but her twin sister. It is for it that the event did not work. Rejetto, you should not have named the procedures with the same name
HE_OPEN:
begin
startBtn.Hide();
updateUrlBox();
// this happens when the server is switched on programmatically
usingFreePort:= port='';
updatePortBtn();
MAIN.runeventscript('server start'); // mod by mars
end;
HE_CLOSE:
begin
startBtn.show();
updatePortBtn();
updateUrlBox();
MAIN.runeventscript('server stop'); // mod by mars
end;
found the origin of bug with this modif F4 works but the two events are not running
hslib.pas
procedure ThttpSrv.stop();
begin
if assigned(sock) then
try
sock.Close() ;
notify(HE_CLOSE, NIL)
except end;
end;
procedure ThttpSrv.connected(Sender: TObject; Error: Word);
begin if error=0 then ThttpConn.create(self) end;
procedure ThttpSrv.disconnected(Sender: TObject; Error: Word);
begin
// notify(HE_CLOSE, NIL)
end;
with the above codes all is ok, or take my solution at the first post.