Endpoint Library Documentation: Base Classes

The Endpoint base classes are Endpoint itself, its subclass ConnectableEndpoint, and a mixin called ManagedEndpoint. All of these classes are abstract. These classes are shown in the diagram below. The diagram style is a cousin to UML, the main difference being that operations are listed above attributes in the class diagram. Why? Because I like it that way. :)

Endpoint class
			diagram

This is all pretty self-explanatory: Endpoint offers reading and writing primitives, and some common error handling stuff. Its subclass ConnectableEndpoint adds primitives used by "connectable" endpoints. So, a TCP/IP endpoint might derive from ConnectableEndpoint, while a UDP/IP one might derive directly from Endpoint. Or, it could choose to follow the BSD sockets convention and define "connecting" as "choosing a target".

The ManagedEndpoint mixin is a little more strange. It was created because I wanted the ability to change memory and block management schemes within certain Endpoints, specifically AsyncWskEndpoint. The management classes are covered in the next section, but in short, they let a subclass derived from it offer a custom memory management mechanism coupled with a custom block management mechanism which allows the endpoint to recognize blocks in a given stream of data. For example, the MiniPOP client will use a block manager to recognize CRLF-terminated lines as primitive blocks, and certain commands as introducing multi-line responses, which it will also handle. (You need to understand the POP3 protocol to really get what I'm talking about, but when the MiniPOP client appears, you'll be able to see how it works.)


Last modified on 6 October 2001 at 06:53 UTC-7 Go to my home page