libwww - The W3C Protocol Library - PowerPoint PPT Presentation

About This Presentation
Title:

libwww - The W3C Protocol Library

Description:

University of Applied Sciences Gie en-Friedberg. Stefan Sabatzki ... More demonstrative. Libwww, the W3C protocol library 29.06.2004. Request/Response Paradigm ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 29
Provided by: Mand55
Category:

less

Transcript and Presenter's Notes

Title: libwww - The W3C Protocol Library


1
libwww -The W3C Protocol Library
  • Großes Schwerpunktseminar WIUniversity of
    Applied Sciences Gießen-Friedberg
  • Stefan Sabatzki

2
Contents
  • Introduction
  • Structure libwww
  • Programming with libwww
  • Conclusion

3
Contents
  • Introduction
  • What is libwww?
  • Why libwww?
  • Structure libwww
  • Programming with libwww
  • Conclusion

4
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
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
Why libwww?
  • Experimenting and prototyping
  • Performance, modularity and extensibility
  • Free and open source code
  • Mailing lists and active community

7
Contents
  • Introduction
  • Structure libwww
  • Design Model
  • Request/Response Paradigm
  • Data Flow
  • Threads, Eventloops and Filters
  • Modules as Statemachines
  • Programming with libwww
  • Conclusion

8
Design Model
  • Layering as design model

9
Design Model (2)
  • More demonstrative

10
Request/Response Paradigm
  • Application issues request
  • Libwww fulfills request
  • Presented to application on arrival
  • Simultaneous requests handled by Librarycore

11
Data Flow
  • Streams are used to transport data
  • Derived from generic stream
  • Protocol streams
  • Converters
  • Presenters
  • I/O streams
  • Basic streams

12
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
Data Flow (3)
  • Cascaded streams
  • Stream chains
  • Setup before data arrives

14
Data Flow (4)
  • Setup after data arrives

15
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
Threads, Eventloops and Filters (2)
17
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
Modules as Statemachines (2)

19
Contents
  • Introduction
  • Structure libwww
  • Programming with libwww
  • C Simulation
  • APIs and Library Interfaces
  • Simple Example
  • More Complex Example
  • Conclusion

20
C Simulation
  • Construction/destruction
  • _new / _delete (HTRequest_new /
    HTRequest_delete)
  • Data hiding
  • Inheritance
  • Explicit pointer casting
  • PRIVATE, PUBLIC Makros

21
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
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
More Complex Example
  • Rudimentary commandline browser
  • See project www.dsw

24
Contents
  • Introduction
  • Structure libwww
  • Programming with libwww
  • Conclusion
  • Whats missing?
  • Facts about libwww
  • Personal Opinon

25
Whats missing?
  • Not thread-safe
  • No cookie-jar, only parsing/generation
  • Consistent usage of RegEx
  • C representation

26
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
Personal Opinion
  • Typical opensource project
  • Tricky installation
  • Feels old lt gt IS old
  • Desperate attempt to reach OOP
  • Non-trivial usage, but very flexible and potent

28
Thank you for your attention
  • ?
Write a Comment
User Comments (0)
About PowerShow.com