You are not logged in.
Pages: 1
Hello Ab,
I want to implement THttpServerRequest inheritance,
For example: TWebSocketAsyncServer.ProcessClass
Offline
Why?
I am almost certain it is not something which is worth doing, without making some confusion, in respect to the Single Responsibility SOLID principle.
Anyway, you can already inherit TWebSocketProcessServer and override the ComputeContext() then change it into TWebSocketAsyncServer.ProcessClass property, as you proposed.
Offline
Thank you. I didn't find the ComputeContext method before.
Offline
THttpServerRequest.create ?
mormot.net.async.pas: (row 3366)
3364 HTTP_UPG_FLAGS[hfConnectionUpgrade in fHttp.HeaderFlags];
3365 if fRequest = nil then // created once, if not rejected by OnBeforeBody
3366: fRequest := THttpServerRequest.Create(
3367 fServer, fConnectionID, fReadThread, flags, @fConnectionOpaque)
3368 else
mormot.net.server.pas: (3082; 4088)
3081 // compute the response
3082: req := THttpServerRequest.Create(self, ConnectionID, ConnectionThread,
3083 HTTP_TLS_FLAGS[ClientSock.TLS.Enabled] +
3084 HTTP_UPG_FLAGS[hfConnectionUpgrade in ClientSock.Http.HeaderFlags],
....
4086 if global_verbs[hvOPTIONS] = '' then
4087 global_verbs := VERB_TEXT;
4088: ctxt := THttpServerRequest.Create(self, 0, self, [], nil);
4089 // main loop reusing a single ctxt instance for this thread
4090 reqid := 0;
Last edited by redhan_xp (2023-03-20 06:19:48)
Offline
I need to implement the interface and try it out for the dll. Let me handle it in a different way, thank you
Offline
Pages: 1