Well, I tried a fresh trunk 32 bit at home and there is also didn't respond to the _T.Server.Active := False;
Next I tried a 64 bit laz 1.6.4 and there it worked. I also got your exact result.
I tried some things but also couldn't figure out why you get the exception.
The Active := false triggers a CloseSocket which results in that exception.
Even with some simple console-code with just the THTTPServerThread (and without your TLink-thread) it gave the same exception.
I'm sure the following leak is due to that exception.
Frankly, I find TFPHttpServer in combination with a thread and setting Active := false quite unstable. In 32 bit trunk it doesn't even work. My preferred goto is Synapse for communications. (I already implemented it in my own Delphi program for Google authentication and redirect to local)
var
_T: THTTPServerThread;
begin
writeln('execute 1');
_T := THTTPServerThread.Create(8001);
writeln('execute 2');
sleep(5000);
writeln('execute 3');
_T.Server.Active := False;
writeln('execute 4');
sleep(5000);
_T.WaitFor;
writeln('execute 5');
_T.Destroy;
writeln('execute 6');
end.
execute 1
create http
execute 2
execute http
execute 3
execute 4
exception http: Could not accept a client connection on socket: 296, error 10004
finish http
execute 5
destroy http
execute 6
Heap dump by heaptrc unit
86 memory blocks allocated : 4309/4600
84 memory blocks freed : 4133/4424
2 unfreed memory blocks : 176
True heap size : 196608
True free heap : 196384
Should be : 196176
Call trace for block $00000000001307D0 size 24
$000000010000A702
$00000001000084F7
$0000000100031F86
$0000000100032603
$0000000100032DE0
$0000000100032C43
$0000000100031711
Call trace for block $0000000000126550 size 152
$000000010000A702
$00000001000084F7
$0000000100032C0B
$0000000100031711
$00000001000312FE
$000000010002DB4C line 59 of http_m_listen.pas
$000000010001A49D