NHttp icon indicating copy to clipboard operation
NHttp copied to clipboard

Connected clients list and clients events

Open sensboston opened this issue 8 years ago • 0 comments

Hi Pieter, thanks for the good library (actually, this is the only one http server I've found on github, working without issues with UPnP/DLNA stack)!

Currently I'm working on simple DLNA-compatible media renderer for PC (it works like a built-in to smart TV media renderer). Normally, clients send DLNA "stop" action by existing/stopping work with the renderer but I definitely need to track disconnected clients/sessions in case of abnormal client completion (no "stop" action was sent), to hide media window.

Could you please add this functionality?

P.S. Found small issue (it's definitely not your fault but can be improved): in HttpRequest.cs, line 120. Code below ContentEncoding = Encoding.GetEncoding(encoding[1]); can throw an exception if charset attribute will be equal '*' or "utf-8" (with quotes); these values are legitimate according to RFC 7231, page 8. The best fix is:

  • remove possible quotes from encoding[1]
  • replace wildcard (if any) to utf-8
  • add try/catch statement and process possible exception as utf-8 content encoding

sensboston avatar Sep 16 '17 14:09 sensboston