3.8 Summary

I l @ ve RuBoard

This chapter showed how ACE uses C++ features and the Wrapper Facade pattern to make it easier to program connection-oriented TCP/IP mechanisms correctly and portably in networked applications. We focused on ACE Socket wrapper facades that simplify the use of

  • Network addresses, I/O handles, and basic socket operations and

  • TCP connection establishment and data transfer operations

The next chapter shows how these Socket wrapper facades are used to develop the first iteration of our networked logging service.

The ACE Socket wrapper facades resolve the following problems with the Socket API discussed in Section 2.3:

  • Error-prone APIs ” The ACE Socket wrapper facades ensure that all arguments to Socket APIs are type-safe. Likewise, byte-ordering issues that must be dealt with during address lookup functions are handled by ACE transparently .

  • Overly complex APIs ” By clustering the Socket API into separate classes for actively connecting, passively accepting, and transferring data, the ACE Socket wrapper facades reduce the amount of complexity that's exposed to developers of networked applications. Thus, developers needn't understand all of the ACE Socket wrapper facades to write a networked application, only the parts they use.

  • Nonportable and nonuniform APIs ” The client application and Web server source code compiles and runs correctly and efficiently on all platforms that ACE supports.

The object-oriented design of the ACE Socket wrapper facades also makes it easy to change an application's IPC mechanism without having to modify API arguments and manually change addressing structures and functions. For example, the classes within each communication service type (stream, connected datagram, or datagram) in Figure 3.2 expose a common set of methods that allows them to be interchanged easily using generic programming techniques [Ale0l]. As described in Sidebar 5 on page 57, generic programming and the C++ trait idiom enable the wholesale replacement of functionality via parameterized types. These techniques are also applied to other ACE IPC wrapper facade classes, which are described at the ACE Web site at http://ace.ece.uci.edu.

I l @ ve RuBoard


C++ Network Programming
C++ Network Programming, Volume I: Mastering Complexity with ACE and Patterns
ISBN: 0201604647
EAN: 2147483647
Year: 2001
Pages: 101

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net