Sockets and middleware

This chapter discusses middleware software, which provides layers of functionality on top of the raw operating system and network programming application programming interface (API) support. Middleware works at the application layer of the network stack. It typically comes in the form of libraries that can be included into a coding project. The purpose is to augment or simplify the facilities provided by the lower-level socket APIs. The first role of middleware is, depending on the language, to abstract away operating system differences. The need for middleware is focused upon, and some generic middleware for simplifying low-level network programming are introduced. The basic Berkeley socket APIs in C, and some difficulties that they present are elaborated. The basic pattern of use for TCP and UDP clients and servers and the supporting functionality for creating and using addresses are seen. The process of how cross-platform issues impact the use of the sockets is also discussed in the chapter. Three higher-level middleware packages, HawkNL, SDL_Net, and ACE that isolate programmers from complexity and their own lossy memories are discussed based on a critique of these APIs. The abstractions simplify the use of sockets considerably and isolate the programmer from some underlying operating system problems.