Download presentation
Presentation is loading. Please wait.
Published byBrett Montgomery Modified over 9 years ago
1
Libwww, the W3C protocol library 29.06.2004 libwww - The W3C Protocol Library „Großes Schwerpunktseminar WI“ University of Applied Sciences Gießen-Friedberg Stefan Sabatzki
2
Libwww, the W3C protocol library 29.06.2004 Contents 1.Introduction 2.Structure libwww 3.Programming with libwww 4.Conclusion
3
Libwww, the W3C protocol library 29.06.2004 Contents 1.Introduction –What is libwww? –Why libwww? 2.Structure libwww 3.Programming with libwww 4.Conclusion
4
Libwww, the W3C protocol library 29.06.2004 What is libwww? Generic framework for building web applications Written in C Pluggable modularity Means to provide most common Internet access methods Transmit data in many different media formats Dataflow to and from the server
5
Libwww, the W3C protocol library 29.06.2004 What is libwww? (2) First version implemented 1992 by Tim Berners-Lee Development at CERN 1994 libwww moved from CERN to W3C 1998 released as opensource As of September 2003 W3C stopped work on libwww As of January 2004 libwww officially belongs to the „Open Source Community“
6
Libwww, the W3C protocol library 29.06.2004 Why libwww? Experimenting and prototyping Performance, modularity and extensibility Free and open source code Mailing lists and active community
7
Libwww, the W3C protocol library 29.06.2004 Contents 1.Introduction 2.Structure libwww –Design Model –Request/Response Paradigm –Data Flow –Threads, Eventloops and Filters –Modules as Statemachines 3.Programming with libwww 4.Conclusion
8
Libwww, the W3C protocol library 29.06.2004 Design Model Layering as design model
9
Libwww, the W3C protocol library 29.06.2004 Design Model (2) More demonstrative
10
Libwww, the W3C protocol library 29.06.2004 Request/Response Paradigm Application issues request Libwww fulfills request Presented to application on arrival Simultaneous requests handled by Librarycore
11
Libwww, the W3C protocol library 29.06.2004 Data Flow Streams are used to transport data Derived from generic stream –Protocol streams –Converters –Presenters –I/O streams –Basic streams
12
Libwww, the W3C protocol library 29.06.2004 Data Flow (2) Structured streams –Derived from generic stream –Accepts structured document –Ordered tree-structured arrangement of data –Each instance is associated with SMGL parser –Each instance is associated with corresponding DTD
13
Libwww, the W3C protocol library 29.06.2004 Data Flow (3) Cascaded streams –Stream chains –Setup before data arrives
14
Libwww, the W3C protocol library 29.06.2004 Data Flow (4) –Setup after data arrives
15
Libwww, the W3C protocol library 29.06.2004 Threads, Eventloops and Filters Not thread-save Implements pseudo-thread model –Uses non-blocking sockets –Based on callback functions Before/After-Filter –Global and local filters –Registered at runtime
16
Libwww, the W3C protocol library 29.06.2004 Threads, Eventloops and Filters (2)
17
Libwww, the W3C protocol library 29.06.2004 Modules as Statemachines Since libwww 3.0 Protocol modules implemented as statemachines Part of thread-model Keep track of current state in communication interface
18
Libwww, the W3C protocol library 29.06.2004 Modules as Statemachines (2)
19
Libwww, the W3C protocol library 29.06.2004 Contents 1.Introduction 2.Structure libwww 3.Programming with libwww –C++ Simulation –APIs and Library Interfaces –Simple Example –More Complex Example 4.Conclusion
20
Libwww, the W3C protocol library 29.06.2004 C++ Simulation Construction/destruction –*_new / *_delete (HTRequest_new / HTRequest_delete) Data hiding Inheritance –Explicit pointer casting PRIVATE, PUBLIC Makros
21
Libwww, the W3C protocol library 29.06.2004 APIs and Library Interfaces Set of APIs called packages Win32: DLLs Unix: separate static libraries Package interface exported via single include file: WWW*.h Some important packages –Basic Utility Packages –Core Packages –Initialization Packages –Transport Packages –Protocol Packages –Parser Packages
22
Libwww, the W3C protocol library 29.06.2004 Simple Example Displays all links in document Applicable to text, html/xml tags, etc. // snippet... HText_registerLinkCallback(foundLink);. HTEventList_loop(request);... foundLink (...) { HTAnchor * dest = HTAnchor_followMainLink(...); char * address = HTAnchor_address(dest); HTPrint("Found link `%s\'\n", address); HT_FREE(address); }
23
Libwww, the W3C protocol library 29.06.2004 More Complex Example Rudimentary commandline browser See project www.dsw
24
Libwww, the W3C protocol library 29.06.2004 Contents 1.Introduction 2.Structure libwww 3.Programming with libwww 4.Conclusion –What‘s missing? –Facts about libwww –Personal Opinon
25
Libwww, the W3C protocol library 29.06.2004 What‘s missing? Not thread-safe No cookie-jar, only parsing/generation Consistent usage of RegEx C++ representation
26
Libwww, the W3C protocol library 29.06.2004 Facts about libwww Who uses libwww? No one? Sample applications on project homepage No reviews, benchmarks, comparisons Not ‚bug free‘ ‚Competitors‘ (mostly UNIX) –WinInet –Libghttp –Libcurl –Libhttp –Neon
27
Libwww, the W3C protocol library 29.06.2004 Personal Opinion Typical opensource project Tricky installation ‚Feels‘ old IS old Desperate attempt to reach OOP Non-trivial usage, but very flexible and potent
28
Libwww, the W3C protocol library 29.06.2004 Thank you for your attention ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.