+ All Categories
Home > Documents > libwww - The W3C Protocol Library

libwww - The W3C Protocol Library

Date post: 19-Jan-2016
Category:
Upload: gitel
View: 43 times
Download: 0 times
Share this document with a friend
Description:
libwww - The W3C Protocol Library. „Großes Schwerpunktseminar WI“ University of Applied Sciences Gießen-Friedberg Stefan Sabatzki. Contents. Introduction Structure libwww Programming with libwww Conclusion. Contents. Introduction What is libwww? Why libwww? Structure libwww - PowerPoint PPT Presentation
Popular Tags:
28
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
Transcript
Page 1: libwww - The W3C Protocol Library

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

Page 2: libwww - The W3C Protocol Library

Libwww, the W3C protocol library 29.06.2004

Contents

1. Introduction

2. Structure libwww

3. Programming with libwww

4. Conclusion

Page 3: libwww - The W3C Protocol Library

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

Page 4: libwww - The W3C Protocol Library

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

Page 5: libwww - The W3C Protocol Library

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“

Page 6: libwww - The W3C Protocol Library

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

Page 7: libwww - The W3C Protocol Library

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

Page 8: libwww - The W3C Protocol Library

Libwww, the W3C protocol library 29.06.2004

Design Model

• Layering as design model

Page 9: libwww - The W3C Protocol Library

Libwww, the W3C protocol library 29.06.2004

Design Model (2)

• More demonstrative

Page 10: libwww - The W3C Protocol Library

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

Page 11: libwww - The W3C Protocol Library

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

Page 12: libwww - The W3C Protocol Library

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

Page 13: libwww - The W3C Protocol Library

Libwww, the W3C protocol library 29.06.2004

Data Flow (3)

• Cascaded streams– Stream chains– Setup before data arrives

Page 14: libwww - The W3C Protocol Library

Libwww, the W3C protocol library 29.06.2004

Data Flow (4)

– Setup after data arrives

Page 15: libwww - The W3C Protocol Library

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

Page 16: libwww - The W3C Protocol Library

Libwww, the W3C protocol library 29.06.2004

Threads, Eventloops and Filters (2)

Page 17: libwww - The W3C Protocol Library

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

Page 18: libwww - The W3C Protocol Library

Libwww, the W3C protocol library 29.06.2004

Modules as Statemachines (2)

Page 19: libwww - The W3C Protocol Library

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

Page 20: libwww - The W3C Protocol Library

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

Page 21: libwww - The W3C Protocol Library

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

Page 22: libwww - The W3C Protocol Library

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);

}

Page 23: libwww - The W3C Protocol Library

Libwww, the W3C protocol library 29.06.2004

More Complex Example

• Rudimentary commandline browser• See project www.dsw

Page 24: libwww - The W3C Protocol Library

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

Page 25: libwww - The W3C Protocol Library

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

Page 26: libwww - The W3C Protocol Library

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

Page 27: libwww - The W3C Protocol Library

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

Page 28: libwww - The W3C Protocol Library

Libwww, the W3C protocol library 29.06.2004

Thank you for your attention

?


Recommended