[Live-devel] Logging for analytics
Ross Finlayson
finlayson at live555.com
Mon Jun 9 05:57:48 PDT 2014
> I'm looking to log information about connections for analytics. I've written a proxy style RTSP server on top of the RTSPServer class, which is very loosely based on the proxy example with the library. Logging new connection information is easy, but what I would like to do create a single line log entry containing the streamName and bytes sent at connection teardown time. It would be nice to have the connection's starting time and ending time in that line too.
>
> I don't see any easy to use hooks, while OnDemandServerMediaSubsession::deleteStream is called when a client connection ends, I'd hate to make custom implementations of the entire tree just to implement the equivalent of a callback with logging info, not to mention getting the specific data I'm interested in there.
You don't need to "make custom implementations of the entire tree" (whatever that means :-) What you can probably do is - in your "OnDemandServerMediaSubsession" subclass, redefine the virtual function
virtual void deleteStream(unsigned clientSessionId, void*& streamToken);
Have it use the "clientSessionId" as a key for whatever extra information you want to keep about this session. (I.e., you could maintain your own hash table, indexed by "clientSessionId".)
The last thing that your custom "deleteStream()" implementation would be to call the original - i.e., call
OnDemandServerMediaSubsession::deleteStream(clientSessionId, streamToken);
> We're likely to push any changes in the library level back to the live555 project.
Note that if - as described here - you make changes only to your own subclassed code, then you are under no obligation to share it. If, however, you make changes to the supplied "LIVE555 Streaming Media" code (i.e., without subclassing), then it will be subject to the LGPL; see
http://www.live555.com/liveMedia/faq.html#copyright-and-license
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140609/c00541d8/attachment.html>
More information about the live-devel
mailing list