mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Check for INDY in new SSE controller
This commit is contained in:
parent
6fbfa6190b
commit
4f9243826a
@ -98,10 +98,15 @@ const
|
||||
EOL = #13#10;
|
||||
begin
|
||||
inherited;
|
||||
lLastEventID := Context.Request.Headers[TMVCConstants.SSE_LAST_EVENT_ID].Trim;
|
||||
{TODO -oDanieleT -cSSE : We've to find a workaround for Apache modules and ISAPIs}
|
||||
if not (Context.Response.RawWebResponse is TIdHTTPAppResponse) then
|
||||
begin
|
||||
raise EMVCException.Create(HTTP_STATUS.InternalServerError, ClassName + ' can only be used with INDY based application server');
|
||||
end;
|
||||
|
||||
lRawContext := TIdHTTPAppResponseAccess(Context.Response.RawWebResponse).FThread;
|
||||
|
||||
lLastEventID := Context.Request.Headers[TMVCConstants.SSE_LAST_EVENT_ID].Trim;
|
||||
|
||||
lIOHandler := lRawContext.Connection.IOHandler;
|
||||
lIOHandler.WriteBufferOpen();
|
||||
lIOHandler.WriteLn('HTTP/1.1 200 OK');
|
||||
@ -144,6 +149,7 @@ begin
|
||||
end;
|
||||
Sleep(200); //arbitrary... some better approches?
|
||||
end;
|
||||
lRawContext.Connection.Disconnect;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user