![]() |
![]() |
Welcome to the August 2004 edition of Riverace's ACE News and Tips newsletter. This issue contains a tip for the most common way of initializing an ACE_Svc_Handler-derived service instance, news about what's coming up in the next ACE release, and good news about a new low-cost edition of C++NPv1 for sale in India and nearby countries. Please forward this newsletter to anyone you think may be interested! Anyone who wishes to receive their own copy of this newsletter can subscribe at http://www.riverace.com/subscribe2/index.mv. If you no longer wish to subscribe, removal directions are at the bottom of this page. Please reply with any feedback you have on this newsletter, as well as ideas for information you'd like to see in upcoming newsletters. We want to be as helpful as possible, so please let us know how we can do that. Tip: Initializing a New ACE_Svc_HandlerACE_Svc_Handler is often used as the base class for network service classes because it's easy to use as an Active Object or in the Reactor framework (or both!). APG section 7.6 discusses how to use ACE_Svc_Handler as a target in the Acceptor-Connector framework, and C++NPv2 chapter 7 goes into depth about its design in the context of Acceptor-Connector. The ACE_Svc_Handler::open() hook method is usually where you perform initial setup for a newly connected service. For example, if the service logs any information about the new connection, open() would be a good place for that. For services that use the Reactor framework to detect arrival of network data, the open() hook is also a good place to do reactor registration. In fact, it's such a good place for reactor registration, and that action is so common to newly connected services, the default action of ACE_Svc_Handler::open() is: if (this->reactor () && this->reactor ()->register_handler
(this,
ACE_Event_Handler::READ_MASK) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_LIB_TEXT ("%p\n"),
ACE_LIB_TEXT ("unable to register client handler")),
-1);
return 0;
So, if all you want to do when connecting a new service is register with the reactor for read events, you need not even implement open(void*) in your class. ACE does it for you! Also note that if the reactor registration fails, the default open() method returns -1, which causes the Acceptor-Connector framework to close the new connection and delete the handler. ACE.next: What's New?The ACE development community is hard at work on the next version of ACE. Here are some of the things you can look forward to:
C++NPv1 for IndiaC++ Network Programming, Volume 1: Mastering Complexity with ACE and Patterns is now available in a special low-price edition that Addison-Wesley sells only in India, Bangladesh, Pakistan, Nepal, Sri Lanka, and the Maldives (ISBN 81-7808-751-0). Users in these countries interested in the book should check with local book outlets for more information or contact Addison Wesley Asia. New Project Coming Up?If you're planning a new project to start soon, or find yourself grappling with how to apply ACE to your current project, remember that Riverace provides world-class development and consulting services with special expertise in ACE. We can help you be sure that your new system is designed to take full advantage of ACE's power and flexibility, getting your system delivered in the shortest possible time and with the highest level of quality. Please contact Steve Huston at 508-541-9180 to discuss how Riverace can help you. |
Useful ACE Information
Quotables"I also wanted to take this opportunity to express my appreciation for the quality and responsiveness of your organization. It is a very rare pleasure to work with an organization that provides in-depth technical support while remaining strongly customer focused - a fact you clearly demonstrate on every interaction. With your help, we have been able to dramatically improve our development schedule while reducing the overall cost and resources required. Riverace has exceeded our expectations without exception." Christopher W. Midgley This Newsletter...... is produced by Riverace Corporation to educate the ACE user community about ACE and available ACE resources, give tips on how to use ACE more effectively, and explain how Riverace can help you make the most of this powerful toolkit. About UsRiverace Corporation is the premier support service provider for the ACE toolkit worldwide. Steve Huston, Riverace's President/CEO and founder, has over 20 years' experience developing network protocols and applications. He has coauthored three books on ACE's design and usage and is considered an expert by ACE users around the world. Riverace has been focused on providing world-class technical support and consulting services for ACE since 1997. |