7541 lines
273 KiB
HTML
Executable File
7541 lines
273 KiB
HTML
Executable File
<! This document generated using mif2html Version 1.0 - Walt Akers - 1996 !>
|
|
<head>
|
|
<title>CDEV Generic Server</title>
|
|
</head>
|
|
|
|
<body bgcolor="#E0E0FF">
|
|
|
|
<body>
|
|
<! ************************ FILE : cdevGenericServerTITLE.mif *****************************!>
|
|
<br><hr><br>
|
|
<table width=100%>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start ADDRESS ***!><font size=+12 color=Black><strong><em>
|
|
The CDEV Generic Server
|
|
<!*** Finish ADDRESS ***!></p></strong></em></font>
|
|
<!*** Start ADDRESS-SUBHEAD ***!><font size=+2 color=Black><strong>
|
|
A CDEV Extension Library for Building Client/Server Systems
|
|
<!*** Finish ADDRESS-SUBHEAD ***!></p></strong></font>
|
|
<!*** Start ADDRESS-VERSION ***!><font size=+2 color=Black>
|
|
|
|
</p>
|
|
Version 1.5 December 9, 1996
|
|
</p>
|
|
|
|
</p>
|
|
Walt Akers, Chip Watson, Jie Chen
|
|
</p>
|
|
|
|
</p>
|
|
TJNAF - Thomas Jefferson National Accelerator Facility
|
|
</p>
|
|
|
|
<!*** Finish ADDRESS-VERSION ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<! *************************** TABLE OF CONTENTS ****************************!>
|
|
<br><hr><br>
|
|
<table width=100%>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top align=center>
|
|
<!*** Start CLASS-TOC-TITLE ***!><font size=+3><strong>
|
|
Table of Contents
|
|
<!*** Finish CLASS-TOC-TITLE ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
1.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF1">Overview of the CDEV Generic Server Engine</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF2">Purpose of This Document</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF3">Intended Audience</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF4">What is the CDEV Generic Server Engine</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF5">Why Use the CDEV Generic Server Engine</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF6">Features</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
2.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF7">Building the CDEV Generic Server Engine</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF8">Steps for Compiling and Testing the CDEV Generic Server Engine</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
3.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF9">The <em>Reflector</em> Server - A Simple Client/Server System</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF10">Overview</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF11">Reflector Server Source Code</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF12">ReflectorServer Header Files</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF13">The ReflectorServer Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF14">The main Function</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF15">The ReflectorService Source Code</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF16">The ReflectorService.h Header File</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF17">The newReflectorService Function</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF18">The ReflectorService Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF19">The CDEV DDL File</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF20">Testing the Reflector Server</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
4.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF21">Server Class Hierarchy</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF22">Server Classes</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF23">FifoQueue Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF24">MultiQueue Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF25">ClientSession Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF26">Attributes of the ClientSession Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF27">localID </a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF28">clientID</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF29">socketID</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF30">SocketSession Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF31">Attributes of the SocketSession Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF32">socketID</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF33">ClientAcceptor Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF34">SocketReader Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF35">SocketWriter Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF36">ClientHandler Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF37">cdevSessionManager Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF38">cdevServer Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
5.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF39">Client Class Hierarchy</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF40">Client Classes</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF41">SocketReader Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF42">SocketWriter Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF43">ServerHandler Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF44">ServerHandlerCallback Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF45">ServerConnectionList Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF46">cdevServerInterface Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF47">cdevClientRequestObject Class </a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF48">cdevClientService Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
6.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF49">Properties of the cdevSessionManager Class</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF50">Overview</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF51">Attributes of the cdevSessionManager Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF52">Reactor</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF53">trigger</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF54">rate</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF55">localIdx</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF56">inbound</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF57">clients</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF58">sockets</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF59">Methods of the cdevSessionManager Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF60">getNextLocalID</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF61">newClientSession</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF62">newClientSession</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF63">findLocalClient</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF64">findClient</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF65">findSocket</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF66">addClient</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF67">addSocket</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF68">removeClient</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF69">removeSocket</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF70">enqueue</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF71">enqueue</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF72">dequeue</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF73">decodePacket</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF74"></strong> <strong>encodePacket</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF75">get_handle</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF76">handle_input</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF77">handle_close</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF78">handle_timeout</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF79">set_rate</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF80">get_rate</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF81">processMessages</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
7.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF82">Properties of the cdevServer Class</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF83">Overview</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF84">Attributes of the cdevServer Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF85">Finished</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF86">serverName</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF87">acceptor</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF88">timer</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF89">status</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF90">Methods of the cdevServer Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF91">cdevServer</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF92">newClientSession</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF93">newSocketSession</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF94">dequeue</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF95">decodePacket</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF96">encodePacket</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF97">operational</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
8.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF98">Properties of the cdevServerInterface Class</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF99">Overview</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF100">Attributes of the cdevServer Interface Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF101">Reactor</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF102">connections</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF103">domain</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF104">defaultServer</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF105">defaultServerHandler</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF106">maxFd</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF107">fdList</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF108">Methods of the cdevServer Interface Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF109">cdevServerInterface</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF110">getDefault</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF111">getDomain</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF112">setDefault</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF113">connect</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF114">disconnect</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF115">enqueue</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF116">getFd</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF117">flush</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF118">pend</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
9.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF119">Properties of the cdevClientService Class</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF120">Overview</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF121">Attributes of the cdevClientService Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF122">callback</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF123">transactions</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF124">contexts</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF125">tagCallback</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF126">Methods of the cdevClientService Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF127">cdevClientService</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF128">defaultCallback</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF129">outputError</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF130">flush</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF131">pend</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF132">poll</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF133">pend</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF134">getNameServer</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF135">getRequestObject</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF136">enqueue</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF137">cancel</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF138">enqueue</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF139">fireCallback</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
10.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF140">Properties of the cdevClientRequestObject Class</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF141">Overview</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF142">Attributes of the cdevClient RequestObject Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF143">sendStatus</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF144">server</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF145">DDL_server</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF146">syncCallback</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF147">handler</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF148">contextID</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF149">commandCode</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF150">messageCode</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF151">Methods of the cdevClient RequestObject Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF152">constructor</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF153">setContext</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF154">send </a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF155">sendNoBlock</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF156"> sendCallback</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF157">className</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF158">defaultCallback</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF159">executeServer HandlerCallback</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF160">getServerHandler</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF161">getContextID</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF162">getCommandCode</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF163">getMessageCode</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
11.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF164">Implementing Monitoring on the cdevServer</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF165">Overview</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF166">Special Notes</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF167">Attributes of the cdevMonitorTable Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF168">monitors</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF169">Methods of the cdevMonitorTable Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF170">insertMonitor</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF171">removeMonitor</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF172">remove ClientMonitors</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF173">findMonitor</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF174">fireMonitor</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF175">fireCallback</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF176">Attributes of the cdevMonitorNodeClass</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF177">parent</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF178">node</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF179">hashString</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF180">Methods of the cdevMonitorNode Class</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF181">fireMonitor</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF182">isMonitored</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
12.
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF183">VirtualService: A Complex Client/Server Implementation</a>
|
|
<!*** Finish HEADING1TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF184">Overview</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF185">Virtual Server Structure</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start UHEADING2TOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF186">Virtual Service Structure</a>
|
|
<!*** Finish UHEADING2TOC ***!><br></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF187">VirtualAttrib.h</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF188">VirtualAttrib.cc</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF189">VirtualServer.h</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF190">VirtualServer.cc</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF191">VirtualService.h</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF192">VirtualService.cc</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_NAMETOC ***!><font size=+1 color=Black>
|
|
<a href="cdevGenericServer.html#TOCREF193">Virtual.ddl</a>
|
|
<!*** Finish FUNC_NAMETOC ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
</table>
|
|
<! **************************** LIST OF FIGURES *****************************!>
|
|
<br><hr><br>
|
|
<table width=100%>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top align=center>
|
|
<!*** Start CLASS-LOF-TITLE ***!><font size=+3><strong>
|
|
List of Figures
|
|
<!*** Finish CLASS-LOF-TITLE ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
|
|
Figure 10:
|
|
<a href="cdevGenericServer.html#LOFREF1">ReflectorServer.cc - Source Code for the Reflector Server</a>
|
|
<!*** Finish FIGURELOF ***!><br></font>
|
|
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
|
|
Figure 11:
|
|
<a href="cdevGenericServer.html#LOFREF2">ReflectorService.h - Header File for the Reflector Service</a>
|
|
<!*** Finish FIGURELOF ***!><br></font>
|
|
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
|
|
Figure 12:
|
|
<a href="cdevGenericServer.html#LOFREF3">ReflectorService.cc - Source Code for the Reflector Service</a>
|
|
<!*** Finish FIGURELOF ***!><br></font>
|
|
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
|
|
Figure 13:
|
|
<a href="cdevGenericServer.html#LOFREF4">Reflector.ddl - A Simple CDEV DDL File</a>
|
|
<!*** Finish FIGURELOF ***!><br></font>
|
|
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
|
|
Figure 1:
|
|
<a href="cdevGenericServer.html#LOFREF5">Object Hierarchy of Server Classes</a>
|
|
<!*** Finish FIGURELOF ***!><br></font>
|
|
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
|
|
Figure 2:
|
|
<a href="cdevGenericServer.html#LOFREF6">Object Hierarchy of Client Classes</a>
|
|
<!*** Finish FIGURELOF ***!><br></font>
|
|
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
|
|
Figure 3:
|
|
<a href="cdevGenericServer.html#LOFREF7">General Structure of the cdevMonitorTable</a>
|
|
<!*** Finish FIGURELOF ***!><br></font>
|
|
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
|
|
Figure 4:
|
|
<a href="cdevGenericServer.html#LOFREF8">Components of the Virtual Server</a>
|
|
<!*** Finish FIGURELOF ***!><br></font>
|
|
<!*** Start FIGURELOF ***!><font size=+1 color=Black>
|
|
Figure 5:
|
|
<a href="cdevGenericServer.html#LOFREF9">Components of the Virtual Service</a>
|
|
<!*** Finish FIGURELOF ***!><br></font>
|
|
</td></tr>
|
|
</table>
|
|
<! ************************ FILE : cdevGenericServer.mif *****************************!>
|
|
<br><hr><br>
|
|
<table width=100%>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
1.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF1">
|
|
Overview of the CDEV Generic Server Engine
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF2">
|
|
Purpose of This
|
|
Document
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
This document is designed to provide an overview and tutorial of how to implement
|
|
client/server applications by using the CDEV Generic Server Engine. Adherence to
|
|
the structure and syntax that is specified in this document will improve the likelihood
|
|
that the CDEV service/server developer's application will be compatible with other
|
|
similar applications using CDEV.
|
|
</p>
|
|
The class library was designed to be as efficient as possible and still maintain the
|
|
flexibility to allow CDEV client/server developers to use it with minimal modification. In
|
|
addition to describing the conceptual behavior of the server, this document will also
|
|
discuss the C++ classes and how inheritance and overloading may be used to build
|
|
the best server for your application.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF3">
|
|
Intended Audience
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
This document is intended for anyone who will be developing a CDEV server or will be
|
|
developing CDEV applications that will communicate with one another over a network.
|
|
This document will also be useful for software developers who wish to develop a non-
|
|
CDEV application that can communicate with an existing server that uses this class
|
|
library.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF4">
|
|
What is the CDEV
|
|
Generic Server
|
|
Engine
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The CDEV Generic Server Engine is a collection of C++ classes that may be used to
|
|
quickly develop a client/server application. The communications component of the
|
|
library is based on the Adaptive Communications Environment (ACE), a freeware
|
|
product developed by Douglas Schmidt that is provided with the CDEV distribution.
|
|
</p>
|
|
CDEV servers use a global CDEV Name Server (provided with the source code
|
|
distribution) to register themselves. The client services can then use this Name Server
|
|
to locate servers by type, name or host. The Name Server insures that each server
|
|
name is unique within its type or domain. Servers that have not reregistered within a
|
|
specific time period (usually 60 seconds) are automatically removed from the Name
|
|
Server.
|
|
</p>
|
|
Clients and servers that are developed using this library will use the CDEV Linear
|
|
Internet Protocol to communicate. The documentation for this protocol is provided with
|
|
the CDEV distribution and its use ensures that the developer's server will be
|
|
accessible by all CDEV compliant applications.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF5">
|
|
Why Use the CDEV
|
|
Generic Server
|
|
Engine
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The CDEV Generic Server Engine provides a robust and reliable mechanism for
|
|
quickly developing client/server applications. Because all of the network
|
|
communications intricacies are isolated by the C++ classes, the developer's server
|
|
can easily be modified and upgraded without significant modification to the network
|
|
internals. Additionally, by using CDEV, the client does not need to be 'network-aware',
|
|
the client C++ class library does all of the communications work.
|
|
</p>
|
|
The CDEV Generic Server Engine also provides a myriad of features that would
|
|
require a significant investment in time to develop for each new server. These features
|
|
are described in detail below.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF6">
|
|
Features
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
The developer is only required to create a subclass of the cdevServer C++ class
|
|
and overload a single method in order to generate the communications
|
|
component of his server.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
The complete client communications portion of the application is accomplished by
|
|
inheriting a CDEV service class from the cdevClientService C++ class and writing
|
|
a boiler plate service loader.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
The engine uses the CDEV Linear Internet Protocol (CLIP) to communicate. This
|
|
protocol uses cdevData objects (a self-describing data structure) to transfer data
|
|
allowing unique, application specific data structures to be transferred without
|
|
modifying the protocol.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
The client and server side of the application use a global CDEV Name Server to
|
|
register and locate various servers by their type, name or host.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
The socket utility classes use embedded buffering to optimize asynchronous
|
|
communications and increase communications speed.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
The communications interface is completely abstracted from the client application.
|
|
Because the application has only a CDEV view of the world, the underlying
|
|
communications engine can be modified or upgraded without breaking the
|
|
program.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
Clients automatically reconnect to server following a disconnect or
|
|
communications error.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
Communications integrity is ensured by using TCP/IP and the Adaptive
|
|
Communications Environment (ACE) C++ library.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
The server supports multiple concurrent client connections. Because the inbound
|
|
data is read incrementally and buffered, a slow client will not cause the server to
|
|
block while waiting for a transmission to be completed.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
The server is completely event driven. It is activated whenever a client submits a
|
|
packet or packets, otherwise, it sleeps until it has inbound data to process.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
An individual tag map is maintained for each connection. When data is received
|
|
the server will map the contents of the clients cdevData objects to the server's
|
|
representation prior to processing. The cdevData objects are remapped to the
|
|
client's representation prior to returning results.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
The server has built-in mechanisms for storing, executing and removing client
|
|
specified monitors on server data objects. This monitoring capability easily allows
|
|
application developers to create event-driven client programs that respond to
|
|
changes in the server.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
<img src="bullet.jpg">
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BULLETED ***!><font size=+1 color=Black>
|
|
A timer-based CDEV 'polling' class is provided that allows the server to attach to
|
|
other CDEV servers or services to obtain information.
|
|
<!*** Finish BULLETED ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
2.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF7">
|
|
Building the CDEV Generic Server Engine
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF8">
|
|
Steps for
|
|
Compiling and
|
|
Testing the CDEV
|
|
Generic Server
|
|
Engine
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED1 ***!><font size=+1 color=Black>
|
|
1.
|
|
<!*** Finish NUMBERED1 ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED1 ***!><font size=+1 color=Black>
|
|
<strong>Install and compile the CDEV source code distribution</strong>. See the CDEV
|
|
distribution for specific instructions for compiling these libraries.
|
|
<!*** Finish NUMBERED1 ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
2.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Compile the Adaptive Communications Environment (ACE) Library. </strong>ACE is
|
|
located at the same level as the 'src' directory in the CDEV distribution tree. The
|
|
README file located in that directory will provide specific instructions on building
|
|
this library on your system. The ACE libraries should be automatically copied to
|
|
the CDEV library directory.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
3.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Setup the Makefile for your platform.</strong> In the directory <em>include/makeinclude </em>there
|
|
are a collection of makefiles that are followed by the name of the platform for
|
|
which they were developed. Link the makefile associated with your platform to the
|
|
file Makefile.OS by typing the following command: <em>"ln -s Makefile.XXXX
|
|
Makefile.OS".</em>
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
<!*** Start NUMBERED-EXTRA ***!><font size=+1 color=Black>
|
|
If a makefile for your platform does not already exist, you may have to create one
|
|
in that directory.
|
|
<!*** Finish NUMBERED-EXTRA ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
4.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Compile the cdevGenericServer Library</strong>. The source code tree for this
|
|
distribution is located in the directory $CDEV/extensions/cdevGenericServer.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
<!*** Start NUMBERED-EXTRA ***!><font size=+1 color=Black>
|
|
The makefile for this library requires the same environment variables that are
|
|
used by the main CDEV makefile.
|
|
<!*** Finish NUMBERED-EXTRA ***!></p></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME_INDENT ***!><font size=+1 color=Black><strong>
|
|
CDEV
|
|
<!*** Finish FUNC_NAME_INDENT ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the root directory of the CDEV distribution.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME_INDENT ***!><font size=+1 color=Black><strong>
|
|
CDEVVERSION
|
|
<!*** Finish FUNC_NAME_INDENT ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the version number of the CDEV class library.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME_INDENT ***!><font size=+1 color=Black><strong>
|
|
CDEVSHOBJ
|
|
<!*** Finish FUNC_NAME_INDENT ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the directory for the CDEV shared objects.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME_INDENT ***!><font size=+1 color=Black><strong>
|
|
CDEVLIB
|
|
<!*** Finish FUNC_NAME_INDENT ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the directory where the CDEV libraries reside.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME_INDENT ***!><font size=+1 color=Black><strong>
|
|
CDEVINCLUDE
|
|
<!*** Finish FUNC_NAME_INDENT ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the directory where the CDEV include files reside.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<!*** Start NUMBERED-EXTRA ***!><font size=+1 color=Black>
|
|
To compile the libraries, go to the cdevGenericServer directory and type make. All
|
|
libraries and the associated test and example applications should be built.
|
|
<!*** Finish NUMBERED-EXTRA ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
5.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Run the test applications to ensure that the code is working correctly.</strong> These
|
|
applications are located in the test sub-directory of the cdevGenericServer tree.
|
|
The test applications require that a special DDL file is specified and that the
|
|
CDEV Name Server is operating. Perform the following steps to test the library.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start SUB-NUMBERED-1 ***!><font size=+1 color=Black>
|
|
5a.
|
|
<!*** Finish SUB-NUMBERED-1 ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SUB-NUMBERED-1 ***!><font size=+1 color=Black>
|
|
<strong>Start the Name Server. </strong>The NameServer application is located in the bin
|
|
directory of the cdevGenericServer distribution tree. The NameServer should
|
|
produce no output and can be executed in the background by typing:
|
|
<em>"NameServer &".</em>
|
|
<!*** Finish SUB-NUMBERED-1 ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
5b.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Specify the host name of the Name Server</strong>.<strong> </strong>Because all applications will
|
|
need to access the Name Server, the host where it is executing should be
|
|
specified in the <em>CDEV_NAME_SERVER</em> environment variable. This variable
|
|
must be specified in the environment of each shell that will need to access the
|
|
Name Server. If the Name Server is running on host <em>foo.cebaf.gov</em>, the Name
|
|
Server environment variable can be set by typing: <em>"setenv
|
|
CDEV_NAME_SERVER foo.cebaf.gov".</em>
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
5c.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Specify the CDEV Device Definition Language file for the test programs.
|
|
</strong>The DDL file for the test programs is named <em>TestService.ddl</em> and is located in
|
|
the test sub-directory of the cdevGenericServer distribution tree. In order for
|
|
this DDL file to be used as the default, it should be specified in the <em>CDEVDDL</em>
|
|
environment variable. This can be accomplished by moving to the test
|
|
directory and typing the following command<em>: "setenv CDEVDDL $PWD/
|
|
TestService.ddl"</em>.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
5d.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Specify the CDEVSHOBJ directory.</strong> The CDEVSHOBJ directory is the
|
|
directory that contains the versioned subdirectories for the service shared
|
|
objects. By default the makefile will place the file TestService.so in the
|
|
directory <em>$CDEV/lib/PLATFORM-OSVERSION.XX/1.5/TestService.so, </em>where
|
|
PLATFORM is the name of your platform and OSVERSION is the major
|
|
operating system. The following example shows the location of the
|
|
TestService.so on a Solaris 5.5 system and the correct setting for the
|
|
CDEVSHOBJ variable.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
<!*** Start SUB-NUMBERED-EXTRA ***!><font size=+1 color=Black>
|
|
|
|
</p>
|
|
<strong>Location</strong>: <em>$CDEV/lib/solaris-5.XX/1.5/TestService.so</em>
|
|
</p>
|
|
<strong>CDEVSHOBJ</strong>: <em>$CDEV/lib/solaris-5.XX</em>
|
|
</p>
|
|
|
|
</p>
|
|
The CDEVSHOBJ variable may point to the directory that actually contains
|
|
the service shared objects, however, CDEV will always attempt to locate the
|
|
files in the version subdirectory first in order to support multiple CDEV
|
|
versions.
|
|
<!*** Finish SUB-NUMBERED-EXTRA ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
5e.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Start the Test Server. </strong>The environment is now correct to start the TestServer.
|
|
From the bin sub-directory type the command: "<em>TestServer</em>". The TestServer
|
|
should print a message indicating that it is ready to process user requests.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
5f.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Specify the Client Tag Map. </strong>In order to test all capabilities of the server, the
|
|
client should use a tag map that is different from the one that is in use on the
|
|
server side of the connection. A special tag map has been provided that can
|
|
be used to test this feature. The tag map is located in the test sub-directory
|
|
and can be specified by moving to the test subdirectory and typing: <em>"setenv
|
|
CDEVTAGMAP $PWD/cdevTagMap.txt"</em>.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
5g.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Start the Test Client.</strong> In a new window, set the CDEV_NAME_SERVER and
|
|
the CDEVDDL environment variables as previously described. The test client
|
|
may then be started by typing the following command <em>"TestProgram"</em>.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
5h.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Examine Test Server and Test Client output.</strong> The server and the client
|
|
should periodically print a line indicating that the packets that they are
|
|
exchanging are correctly matched. If a mismatch occurs, both sides of the
|
|
connection will print out a verbose description of what differences were
|
|
detected.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
5i.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SUB-NUMBERED ***!><font size=+1 color=Black>
|
|
<strong>Terminate the Test Server and the Test Client.</strong> The TestServer and
|
|
TestProgram applications are terminated using CTRL-C. When the
|
|
applications are terminated, they should display a disconnecting message
|
|
and exit gracefully.
|
|
<!*** Finish SUB-NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
3.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF9">
|
|
The <em>Reflector</em> Server - A Simple Client/Server System
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF10">
|
|
Overview
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The Reflector client/server system is a simple CDEV service that returns the
|
|
cdevData object unmodified to the caller. The Reflector server can be used as a
|
|
skeleton for any other server that the developer may wish to create. The source code
|
|
that is provided in the following sections is available in text form in the examples sub-
|
|
directory of the cdevGenericServer directory tree. A more complex example is
|
|
provided in section 11 of this document.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF11">
|
|
Reflector Server
|
|
Source Code
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The server for the Reflector system is instituted as a single C++ file. The source code
|
|
for this application is listed below.
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
|
|
Figure 10:
|
|
<a name="LOFREF1">
|
|
ReflectorServer.cc - Source Code for the Reflector Server
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
#include <cdevServer.h>
|
|
|
|
// ******************************************************************
|
|
// * class ReflectorServer:
|
|
// * This is the server class for the reflector. It simply
|
|
// * receives messages from a client and immediately returns them.
|
|
// *
|
|
// * The constructor passes the domain, server, port and rate to the
|
|
// * underlying cdevServer class to be processed. The cdevServer
|
|
// * constructor will add this server to the Name Server and will
|
|
// * begin processing messages when the cdevServer::runServer()
|
|
// * method is executed.
|
|
// *
|
|
// * The processMessages method is the servers interface to the
|
|
// * world... Each time a complete message is received or the time
|
|
// * specified in rate expires, that method will be called.
|
|
// ******************************************************************
|
|
class ReflectorServer : public cdevServer
|
|
{
|
|
public:
|
|
ReflectorServer ( char *domain, char *server,
|
|
unsigned int port, double rate )
|
|
: cdevServer(domain, server, port, rate)
|
|
{
|
|
}
|
|
|
|
virtual void processMessages ( void )
|
|
{
|
|
cdevMessage * message;
|
|
while(dequeue(message)==0)
|
|
{
|
|
enqueue(message);
|
|
delete message;
|
|
}
|
|
}
|
|
};
|
|
|
|
void main()
|
|
{
|
|
ReflectorServer server("REFLECTOR", "TestServerX", 9120, 60);
|
|
cdevServer::runServer();
|
|
}
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 58>
|
|
</a> <!*** Finish FIGURE ***!></p></em></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF12">
|
|
ReflectorServer
|
|
Header Files
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
In the source code for the Reflector server, the only header file that must be included
|
|
is the one for the cdevServer class. This header contains all of the definition
|
|
information that is required for the Adaptive Communications Environment (ACE) and
|
|
the CDEV Linear Internet Protocol.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF13">
|
|
The
|
|
ReflectorServer
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The ReflectorServer class inherits directly from the cdevServer class. Because
|
|
cdevServer defines all of the functionality necessary to establish a listening socket
|
|
and accept connections, the developers start-up is limited to initializing the
|
|
cdevServer class object with the domain name, server name, listening socket number
|
|
and the time-out rate.
|
|
</p>
|
|
The developer is required to create a processMessages method which will perform
|
|
whatever message processing that is required of the server. In this case, the
|
|
processMessages method will merely remove an entry from the queue and then re-
|
|
enqueue it for return to the client. Note that the enqueue method does not delete the
|
|
cdevMessage object, so it is the responsibility of the developer to delete the
|
|
cdevMessage object when it is no longer needed.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF14">
|
|
The main Function
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The main function is responsible for starting the server when the application is started.
|
|
In order to perform this task, main must first create a new ReflectorServer object. The
|
|
ReflectorServer in this example has the Name Server domain "REFLECTOR" and the
|
|
server name "TestServerX". It will be listening for connections on socket 9120 and will
|
|
automatically process messages at least once every 60 seconds.
|
|
</p>
|
|
When the ReflectorServer was created it automatically registered itself with the ACE
|
|
Reactor that is embedded in the cdevServer class. In order to begin accepting
|
|
connections and processing messages the main function must call the static
|
|
runServer method of the cdevServer class. This method will continue servicing
|
|
requests until the static Finished flag of the cdevServer class is set to non-zero.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF15">
|
|
The
|
|
ReflectorService
|
|
Source Code
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The ReflectorService is the CDEV interface to the ReflectorServer that is described
|
|
above. The source code for the ReflectorServer is implemented as a single source file
|
|
and its associated header file. The source code for the ReflectorService is as follows.
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
|
|
Figure 11:
|
|
<a name="LOFREF2">
|
|
ReflectorService.h - Header File for the Reflector Service
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
#include <cdevClientService.h>
|
|
|
|
// ******************************************************************
|
|
// * Function called to create initial instance of ReflectorService
|
|
// ******************************************************************
|
|
extern "C" cdevService *newReflectorService ( char *, cdevSystem *);
|
|
|
|
// ******************************************************************
|
|
// * class ReflectorService :
|
|
// * This class simply inherits from the cdevClientService and must
|
|
// * define only a constructor and destructor.
|
|
// ******************************************************************
|
|
class ReflectorService : public cdevClientService
|
|
{
|
|
public:
|
|
ReflectorService ( char * name, cdevSystem & system =
|
|
cdevSystem::defaultSystem());
|
|
protected:
|
|
virtual ~ReflectorService ( void ) {};
|
|
};
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 60>
|
|
</a> <!*** Finish FIGURE ***!></p></em></font>
|
|
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
|
|
Figure 12:
|
|
<a name="LOFREF3">
|
|
ReflectorService.cc - Source Code for the Reflector Service
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
#include <ReflectorService.h>
|
|
|
|
// ******************************************************************
|
|
// * newReflectorService:
|
|
// * This function will be called by the cdevSystem object to create
|
|
// * an initial instance of the ReflectorService.
|
|
// ******************************************************************
|
|
extern "C" cdevService * newReflectorService
|
|
(char * name, cdevSystem * system)
|
|
{
|
|
return new ReflectorService(name, *system);
|
|
}
|
|
|
|
// ******************************************************************
|
|
// * ReflectorService::ReflectorService :
|
|
// * This is the constructor for the ReflectorService. It
|
|
// * initializes the underlying cdevClientService by specifying
|
|
// * that it is in the domain of REFLECTOR.
|
|
// ******************************************************************
|
|
ReflectorService::ReflectorService
|
|
( char * name, cdevSystem & system)
|
|
: cdevClientService("REFLECTOR", name, system)
|
|
{
|
|
system.reportError(CDEV_SEVERITY_INFO, "ReflectorService", NULL,
|
|
"Constructing a new ReflectorService");
|
|
}
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 62>
|
|
</a> <!*** Finish FIGURE ***!></p></em></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF16">
|
|
The
|
|
ReflectorService.h
|
|
Header File
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
While the server is not required to have a specific header file, a CDEV service must
|
|
have a header file that may be used to create a loader for the archive version of the
|
|
library. This file is always named xxxxxService.h, where xxxxx is the name of the
|
|
service as it will be specified in the CDEV DDL file. This file must contain the complete
|
|
class definition for the service class.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF17">
|
|
The newReflector
|
|
Service Function
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Each service in CDEV must have a function that the cdevSystem object can call to
|
|
create the initial instance of the object. In the case of the ReflectorService, this
|
|
method will create a new instance of the ReflectorService using the provided name
|
|
and cdevSystem object. This new object will then be returned as a pointer to a
|
|
cdevService object.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF18">
|
|
The
|
|
ReflectorService
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Because of the simplicity of the ReflectorService, all of the functionality of this class is
|
|
inherited from the cdevClientService class. The ReflectorService class is only
|
|
required to initialize its parent classes to be fully operational.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF19">
|
|
The CDEV DDL
|
|
File
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
After compiling this source code into a server application and a CDEV shared library
|
|
using the makefile that is provided in the examples sub-directory, the developer is
|
|
ready to generate a CDEV DDL file that will map certain device/message
|
|
combinations to the Reflector service. The following simple CDEV DDL file can be
|
|
used to map device "device1" and message "get attrib1" to the Reflector Service. Note
|
|
that by entering the server tag in the service data section, the default server name that
|
|
the message will be sent to may be specified. In this case all messages associated
|
|
with the "attrib1" attribute will be sent to "TestServerX".
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
|
|
Figure 13:
|
|
<a name="LOFREF4">
|
|
Reflector.ddl - A Simple CDEV DDL File
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
service Reflector
|
|
{
|
|
tags {server}
|
|
}
|
|
|
|
class Reflectors
|
|
{
|
|
verbs {get}
|
|
attributes
|
|
{
|
|
attrib1 Reflector {server=TestServerX};
|
|
}
|
|
}
|
|
|
|
Reflectors :
|
|
device1,
|
|
;
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 64>
|
|
</a> <!*** Finish FIGURE ***!></p></em></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF20">
|
|
Testing the
|
|
Reflector Server
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
After compiling the server and the service components of the Reflector system, the
|
|
developer can test the functionality of the client/server application by performing the
|
|
following steps.
|
|
<!*** Finish BODY ***!></p></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED1 ***!><font size=+1 color=Black>
|
|
1.
|
|
<!*** Finish NUMBERED1 ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED1 ***!><font size=+1 color=Black>
|
|
Start the Name Server.
|
|
<!*** Finish NUMBERED1 ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
2.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
Set the CDEV_NAME_SERVER environment variable in the shell where you will
|
|
execute the server and the client to indicate the host where you started the Name
|
|
Server. For instance: <em>setenv CDEV_NAME_SERVER cebaf1.cebaf.gov.</em>
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
3.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
Set the CDEVSHOBJ environment variable in the shell where you will start the
|
|
client application to indicate the directory where the ReflectorService.so file is
|
|
stored.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
4.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
Set the CDEVDDL environment variable in the shell where you will start the client
|
|
application to indicate the absolute path to the CDEV DDL file where the Reflector
|
|
definitions have been created.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
5.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
Start the server.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
6.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start NUMBERED ***!><font size=+1 color=Black>
|
|
Start the cdevUtil application that is provided with the CDEV distribution and send
|
|
messages to the server by typing: <em>device1 get attrib1.</em> You may want to enter
|
|
additional output code in the processMessages method of the server to report
|
|
each time a message is received.
|
|
<!*** Finish NUMBERED ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
4.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF21">
|
|
Server Class Hierarchy
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF22">
|
|
Server Classes
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The server side of the CDEV Generic Server Engine library is composed of a series of
|
|
classes that are used in conjunction with the ACE Reactor class to provide event
|
|
driven socket management. The following diagram shows an object diagram of the
|
|
classes that are used on the server side of the connection.
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
|
|
Figure 1:
|
|
<a name="LOFREF5">
|
|
Object Hierarchy of Server Classes
|
|
<AFrame 1>
|
|
</a> <!*** Finish FIGURE ***!></p></em></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF23">
|
|
FifoQueue Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
This class is a simple queue that is used to enqueue inbound messages that are
|
|
received from a socket. Because all messages will be processed by the same method,
|
|
there is only one FifoQueue object that is used by all client sockets. This object
|
|
resides in the cdevSessionManager class.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF24">
|
|
MultiQueue Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
A MultiQueue object is a special type of FifoQueue that allows the caller to create an
|
|
object that is to be placed into the queue and then place it into several queues at
|
|
once. If the message is removed from any queue, it will automatically be removed
|
|
from all other queues where it exists. This mechanism is used to provide the capability
|
|
of removing all of a specific client's outbound packets without stepping through all of
|
|
the packets in the associated socket's queue.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF25">
|
|
ClientSession
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The ClientSession class inherits its queue functionality from the MultiQueue class. It is
|
|
used to hold all outbound packets that are associated with a specific client identifier.
|
|
The ClientSession object also holds supplemental data that the cdevSessionManager
|
|
will need to manage the client. This class be subclassed by the developer in order to
|
|
associate more data with the client identifier. The following information is stored in the
|
|
ClientSession object:
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF26">
|
|
Attributes of the
|
|
ClientSession
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF27">
|
|
localID
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
short localID;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the client identifier that will be used on the server to
|
|
uniquely identify the client.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF28">
|
|
clientID
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int clientID;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the client identifier that was provided by the client
|
|
combined with the socket identifier.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF29">
|
|
socketID
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int socketID;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the socket identifier (file descriptor) to which the client is
|
|
connected.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF30">
|
|
SocketSession
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The SocketSession class inherits its functionality from the MultiQueue class. It is used
|
|
to hold all packets that are destined for a specific socket. The SocketSession object is
|
|
also used to store supplemental data that the cdevSessionManager will need to
|
|
maintain the connection. This class be subclassed by the developer in order to
|
|
associate more data with the socket identifier. The following information is stored in
|
|
the SocketSession object:
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF31">
|
|
Attributes of the
|
|
SocketSession
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF32">
|
|
socketID
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int socketID;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the socket identifier (file descriptor) to which the remote
|
|
client is attached.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF33">
|
|
ClientAcceptor
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The ClientAcceptor class is used by the ACE Reactor to listen to the server socket and
|
|
accept each inbound client connection. When a connection is accepted, this class will
|
|
create a ClientHandler object that will manage the connection throughout its lifetime.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF34">
|
|
SocketReader
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The SocketReader class has the embedded mechanisms to read buffered packets
|
|
from a socket. The ClientHandler inherits the functionality of this class to read data
|
|
that is received on its associated socket.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF35">
|
|
SocketWriter
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The SocketWriter class has the embedded mechanisms to write buffered packets to a
|
|
socket. The class maintains a 56 kilobyte buffer that it uses to enqueue as many
|
|
outbound messages as possible before executing a network write. The ClientHandler
|
|
inherits the functionality of this class to write data to its associated socket.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF36">
|
|
ClientHandler
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
A ClientHandler object is created each time a new connection is accepted by the
|
|
server. This class is used by the ACE Reactor to manage the input and output events
|
|
on the specific socket. When data is received from the socket by the handle_input
|
|
method, the ClientHandler object will enqueue the inbound packet in the FifoQueue
|
|
provided by the cdevSessionManager class. When the cdevSessionManager class
|
|
enqueues outbound packets, the handle_output method of the ClientHandler class will
|
|
write them to the socket using as many write operations as required to transmit all
|
|
data.
|
|
</p>
|
|
When the ClientHandler object is destroyed it will notify the cdevSessionManager
|
|
object which will remove its associated queues and will remove it from the ACE
|
|
Reactor.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF37">
|
|
cdevSessionMan
|
|
ager Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The cdevSessionManager class maintains all of the queues, ClientSession and
|
|
SocketSession objects that are used to operate a server. This class also defines the
|
|
enqueue and dequeue methods that are used by the cdevServer to obtain inbound
|
|
packets and to submit outbound packets.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF38">
|
|
cdevServer Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The cdevServer class inherits the queue management functionality that is provided by
|
|
the cdevSessionManager class and then implements the ClientAcceptor and
|
|
ClientHandler classes to accept and process connections. The cdevServer class also
|
|
introduces the concept of timed execution of the server function and automatic
|
|
registration of the server with the CDEV Name Server.
|
|
</p>
|
|
In order to construct a new CDEV Server application, the developer only needs to
|
|
inherit his server class from the cdevServer class and then define the <em>
|
|
processMessages</em> method. This method will be called whenever the server timer
|
|
expires or when data is ready to be processed in the inbound queue. Once called the
|
|
<em>processMessages</em> method should use the <em>dequeue</em> method to remove the inbound
|
|
cdevMessage object, process the message, and then use the <em>enqueue</em> method to
|
|
return the processed cdevMessage object to the client.
|
|
</p>
|
|
The encodePacket and decodePacket methods of this class are responsible for
|
|
coordinating the tables of context objects, performing tag mapping and converting
|
|
between the local client identifier and the foreign client identifier.
|
|
</p>
|
|
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
5.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF39">
|
|
Client Class Hierarchy
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF40">
|
|
Client Classes
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The client side of the CDEV Generic Server Engine consists of a collection of classes
|
|
that are used in conjunction with the CDEV service architecture and the ACE Reactor
|
|
to provide pollable event driven behavior. The following diagram shows the object
|
|
structure of the classes used by the client.
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
|
|
Figure 2:
|
|
<a name="LOFREF6">
|
|
Object Hierarchy of Client Classes
|
|
<AFrame 31>
|
|
</a> <!*** Finish FIGURE ***!></p></em></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF41">
|
|
SocketReader
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The SocketReader class has the embedded mechanisms to read buffered packets
|
|
from a socket. The ServerHandler inherits the functionality of this class to read data
|
|
that is received on its associated socket.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF42">
|
|
SocketWriter
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The SocketWriter class has the embedded mechanisms to write buffered packets to a
|
|
socket. The class maintains a 56 kilobyte buffer that it uses to enqueue as many
|
|
outbound messages as possible before executing a network write. The ServerHandler
|
|
inherits the functionality of this class to write data to its associated socket.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF43">
|
|
ServerHandler
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
A ServerHandler object is created for each server that the cdevServerInterface wishes
|
|
to communicate with. This object has an embedded FifoQueue object that is used to
|
|
store the outbound packets until the ServerHandler's data is flushed. If the
|
|
ServerHandler receives a sufficient number of packets or volume of data it will
|
|
automatically flush its buffer to the socket. The ServerHandler inherits much of its
|
|
communications functionality from the SocketReader and SocketWriter classes which
|
|
provide buffered communications methods.
|
|
</p>
|
|
The cdevClientRequestObject may obtain a pointer to the ServerHandler that is
|
|
associated with the server that it is communicating with. By referencing this pointer
|
|
when enqueueing messages to the server through the cdevService, the request
|
|
object can increase its performance significantly because it does not have to locate
|
|
the associated ServerHandler on each transmission.
|
|
</p>
|
|
A cdevClientRequestObject that is utilizing a ServerHandler will register itself in a list
|
|
of ServerHandlerCallback objects that are maintained in the ServerHandler object.
|
|
When the ServerHandler is destroyed it will notify each ServerHandlerCallback object
|
|
in the list to allow them to clear their pointers to it, avoiding the inadvertent use of an
|
|
invalid object.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF44">
|
|
ServerHandler
|
|
Callback Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The ServerHandlerCallback class is a virtual base class that any class that uses a
|
|
ServerHandler object may use to detect when the object is destroyed. When an object
|
|
that is inherited from this class is registered with the ServerHandler, it will be called
|
|
prior to deleting the ServerHandler object. The inherited object should then set the
|
|
associated ServerHandler pointer to NULL to prevent inadvertent access to a deleted
|
|
object. The cdevClientRequestObject inherits from this class in order to support this
|
|
functionality.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF45">
|
|
ServerConnection
|
|
List Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The ServerConnectionList is a table of all ServerHandler objects that are currently
|
|
connected to servers. The cdevServerInterface uses this table to locate a
|
|
ServerHandler by the name of its associated server. This table prevents multiple
|
|
connections from inadvertently being established to the same server.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF46">
|
|
cdevServerInter
|
|
face Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
This class has a ServerConnectionList that references all ServerHandlers that are
|
|
connected to servers for the specific service. This object provides the mechanisms
|
|
that are used to enqueue, dequeue, flush, poll and pend on the outbound connections.
|
|
</p>
|
|
The cdevServerInterface class contains an ACE Reactor that is used to respond to
|
|
input/output events that occur on the sockets within the ServerHandlers. Because this
|
|
Reactor is static within the cdevServerInterface class, it will handle events for all of the
|
|
server connections in all of the services that are inherited from it when it is called.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF47">
|
|
cdevClientRe
|
|
questObject Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
This class inherits the majority of its functionality from, the cdevRequestObject class
|
|
and is used to associate a device with a specific message. The identity of the server
|
|
that supports the specific device/message combination may be specified in several
|
|
ways: through the <em>server</em> tag in the context, through the CDEV DDL file, or by the
|
|
server specified by a prior call to <em>set default</em>. If a specific server has been named, the
|
|
cdevClientRequestObject will obtain a pointer to the associated ServerHandler object
|
|
and will use that as a reference when submitting enqueue messages to the
|
|
cdevClientService object. If no server has been specified, then the
|
|
cdevClientRequestObject will set the ServerHandler pointer to NULL and will rely on
|
|
the cdevClientService to use the default server. If no default server has been specified
|
|
then the transmission will fail.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF48">
|
|
cdevClientService
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
This class inherits its functionality from the cdevServerInterface class. While the
|
|
cdevServerInterface class deals exclusively with binary streams and their associated
|
|
lengths, this class is called to enqueue information in the form of device, message,
|
|
data and context. The class will encode this information into the appropriate binary
|
|
format and submit it to the cdevServerInterface for enqueueing. When data is received
|
|
from the server, the cdevServerInterface will provide it to the cdevClientService in the
|
|
form of a binary stream, and the service will decompose it into its CDEV components
|
|
and dispatch the caller specified callback.
|
|
</p>
|
|
Messages are enqueued in the service in the form of cdevTranObjs. The
|
|
cdevClientService manages these messages by maintaining a list of numbered
|
|
transactions. The transaction number associated with a message is embedded in the
|
|
outbound binary packet. When a server responds the same transaction number is
|
|
embedded in the response packet. This transaction number is then used to locate and
|
|
dispatch the associated callback. Once the callback has been executed, the
|
|
transaction object is removed from the list and deleted.
|
|
</p>
|
|
In the event that a message indicates a monitoring operation, the transaction object is
|
|
marked as permanent until a <em>monitorOff </em>operation is executed.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
6.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF49">
|
|
Properties of the cdevSessionManager Class
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF50">
|
|
Overview
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
As described earlier the cdevSessionManager class is responsible for managing the
|
|
queues that are used to read and write data to a collection of sockets that are
|
|
communicating with the server. The public interface to the cdevSessionManager class
|
|
is described below.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF51">
|
|
Attributes of the
|
|
cdevSessionMan
|
|
ager Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF52">
|
|
Reactor
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
static ACE_Reactor Reactor;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the ACE Reactor object that is used to respond to input/
|
|
output events on the individual sockets and to respond to time
|
|
triggered events that are specified by the developer.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF53">
|
|
trigger
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
FD_Trigger trigger;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This class contains an embedded pipe that is used to trigger
|
|
events in the object's ACE_Event_Handler. Each time a new
|
|
packet is enqueued in the cdevSessionManager, a byte is
|
|
written to the pipe within the trigger object, this causes the
|
|
Reactor to call the processMessages method of the
|
|
cdevSessionManager object to handle its input.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF54">
|
|
rate
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
ACE_Time_Value rate;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
Because the cdevSessionManager's processMessages
|
|
method may be called on a periodic basis rather than just when
|
|
a new message has arrived, the rate variable contains the
|
|
period in seconds between each subsequent execution.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF55">
|
|
localIdx
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
static IntHash localIdx;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a table of ClientSession objects that are hashed based
|
|
on the local client index. The local client index is short integer
|
|
that is unique within the server and is used to identify a specific
|
|
client that is communicating through a socket. The
|
|
ClientSession object is the queue that is used to store
|
|
outbound packets that are destined for a specific client.
|
|
Additional client specific information is also stored in the
|
|
ClientSession object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF56">
|
|
inbound
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
FifoQueue inbound;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the queue into which all inbound messages that are
|
|
destined for a specific server are placed. A message is
|
|
enqueued as a binary stream and its associated length.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF57">
|
|
clients
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
IntHash clients;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the table of ClientSession objects that are indexed by
|
|
the client specified client identifier. While the localIdx table is
|
|
global in scope, this table is specific to this instance of the
|
|
cdevSessionManager class. The ClientSession object that is
|
|
referenced by a specific client identifier is used to enqueue
|
|
messages that are destined for that client ID.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF58">
|
|
sockets
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
IntHash sockets;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the table of SocketSession objects that are currently in
|
|
use by this instance of the cdevSessionManager class. The
|
|
SocketSession that is referenced by the socket identifier is
|
|
used to enqueue messages that are destined for that client.
|
|
The ClientHandler object dequeues messages from the queue
|
|
and writes them to the socket using multiple writes if necessary.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF59">
|
|
Methods of the
|
|
cdevSessionMan
|
|
ager Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF60">
|
|
getNextLocalID
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
static short getNextLocalID (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
Because local indexes are short integers that monotonically
|
|
increase, this method is used to obtain the next local index from
|
|
the list.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF61">
|
|
newClientSession
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
ClientSession * newClientSession ( int SocketID,
|
|
</p>
|
|
int ClientID,
|
|
</p>
|
|
int LocalD);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used by the cdevSessionManager whenever it
|
|
needs to create a new ClientSession object. By overriding this
|
|
method the developer may return subclassed ClientSession
|
|
objects that contain additional, server-specific information that
|
|
is associated with the client identifier.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF62">
|
|
newClientSession
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
SocketSession * newSocketSession (int SocketID);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used by the cdevSessionManager whenever it
|
|
needs to create a new SocketSession object. By overriding this
|
|
method the developer may return subclassed SocketSession
|
|
objects that contain additional, server-specific information that
|
|
is associated with the socket.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF63">
|
|
findLocalClient
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual ClientSession * findLocalClient (short localID);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used to obtain a pointer to the ClientSession
|
|
object that is associated with a local client identifier. Because
|
|
the cdevServer object deals exclusively with the local client
|
|
identifier, this method allows it to obtain the ClientSession
|
|
without converting between the local and foreign client ID.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF64">
|
|
findClient
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual ClientSession * findClient (int clientID);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method allows the caller to obtain a pointer to the
|
|
ClientSession associated with a specific client identifier. This
|
|
method uses the remotely specified client ID to locate the
|
|
ClientSession object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF65">
|
|
findSocket
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual SocketSession * findSocket (int socketID);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method allows the caller to locate the SocketSession
|
|
associated with a specific socket identifier. The socket identifier
|
|
is the same as the file descriptor for a specific socket. The
|
|
SocketSession object is the queue that is used by the
|
|
ServerHandler object to dequeue messages that are destined
|
|
for the client.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF66">
|
|
addClient
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual ClientSession * addClient (int socketID, int clientID);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used to add a new ClientSession object to the
|
|
clients list and obtain a pointer to the new object. If a
|
|
ClientSession object already exists for the socketID/clientID
|
|
combination, then a pointer to the existing ClientSession object
|
|
will be returned. If a new ClientSession object is created, then
|
|
this method will cause a "register" message to be generated
|
|
and enqueued in the inbound queue for the cdevServer object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF67">
|
|
addSocket
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual SocketSession * addSocket (int socketID);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used to add a new SocketSession object to the
|
|
sockets list and obtain a pointer to the new object. If a
|
|
SocketSession object already exists for the specific socketID,
|
|
then the existing SocketSession object will be returned.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF68">
|
|
removeClient
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual void removeClient (int clientID, int unregisterFlag=1);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method removes the ClientSession object associated with
|
|
a specific client identifier. If the unregister flag is non-zero, then
|
|
this method will compose and send an "unregister" message to
|
|
the inbound queue to alert the cdevServer object that the client
|
|
(local client identifier) is being removed. The server should then
|
|
remove any monitors that are associated with the local client
|
|
identifier.
|
|
</p>
|
|
This method will remove and delete any outbound messages
|
|
that are destined for the specified client identifier from the
|
|
outbound queues.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF69">
|
|
removeSocket
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual void removeSocket (int socketID);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method removes the SocketSession object associated
|
|
with the specified socket identifier from the sockets list. When a
|
|
socket is removed the ClientHandler associated with the socket
|
|
identifier will be disconnected and deleted and then all
|
|
ClientSession objects that are associated with the socket will
|
|
also be deleted. This message will delete all outbound
|
|
messages that are in the SocketSession queue or in any of its
|
|
associated ClientSession queues.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF70">
|
|
enqueue
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int enqueue (int socketID, char * binary, unsigned len);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used by the ClientHandler object to enqueue
|
|
messages that are destined for the processMessages method.
|
|
The method will create a SocketSession for the ClientHandler if
|
|
one does not already exist and will place the message into the
|
|
inbound queue.
|
|
</p>
|
|
If the message is from a new client identifier, then a new
|
|
ClientSession object is created.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF71">
|
|
enqueue
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int enqueue (cdevPacket * packet);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used to enqueue a packet that is to be returned
|
|
to a client. The cdevPacket structure as described in the CLIP
|
|
literature contains a client identifier that is used to determine to
|
|
which socket the packet should be enqueued.
|
|
</p>
|
|
The enqueue method will call the encodePacket method in
|
|
order to convert the packet into a cdevPacketBinary object to
|
|
be enqueued. The developer may overload that method in
|
|
order to perform any post-processing that may be necessary
|
|
before converting the packet to binary format.
|
|
</p>
|
|
Note, this cdevPacket object remains the property of the caller
|
|
and must be deleted when it is no longer needed.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF72">
|
|
dequeue
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int dequeue (cdevPacket * &packet);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used to dequeue messages that have been
|
|
placed in the inbound queue. The processMessages method
|
|
will then process the message and return the result using the
|
|
enqueue method. Note that the inbound message contains a
|
|
client identifier and other components that must be returned to
|
|
the client unmodified.
|
|
</p>
|
|
The dequeue method will call the decodePacket in order to
|
|
convert the binary cdevPacketBinary object into a cdevPacket
|
|
object. The developer may override that method in order to
|
|
perform any pre-processing that may be necessary before
|
|
returning the packet.
|
|
</p>
|
|
Note, this cdevPacket object becomes the property of the caller
|
|
and must be deleted when it is no longer needed.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF73">
|
|
decodePacket
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual cdevPacket * dequeue (cdevPacketBinary * binary);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method converts a cdevPacketBinary object (as stored in
|
|
the inbound queue) into a cdevPacket object. The developer
|
|
may override this method in order to perform any special pre-
|
|
processing that may be necessary prior to returning the
|
|
cdevPacket object via the dequeue method.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF74">
|
|
</strong> <strong>encodePacket
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual cdevPacketBinary * enqueue (cdevPacket * packet);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method converts a cdevPacket object into a
|
|
cdevPacketBinary object (for submission to the client/socket
|
|
queue). The developer may override this method in order to
|
|
perform any special post-processing that may be necessary.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF75">
|
|
get_handle
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int get_handle (void) const;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method returns the file descriptor that is used by the
|
|
FD_Trigger object. This method is called by the ACE Reactor in
|
|
order to obtain a file descriptor for polling.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF76">
|
|
handle_input
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int handle_input (ACE_HANDLE);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is called by the ACE Reactor whenever the file
|
|
descriptor in the FD_Trigger object has a read event ready. This
|
|
method will, inturn, call the processMessages method to
|
|
dequeue the message from the inbound queue and process it.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF77">
|
|
handle_close
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int handle_close (int, ACE_Reactor_Mask);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is called by the ACE Reactor to close the
|
|
connections associated with this object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF78">
|
|
handle_timeout
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int handle_timeout ( const ACE_Time_Value&,
|
|
</p>
|
|
const void *);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is called by the ACE Reactor when the period
|
|
specified by the Rate parameter has expired. This method will,
|
|
inturn, call the processMessages method to handle events.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF79">
|
|
set_rate
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual void set_rate (double d);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used to alter the rate at which the
|
|
cdevSessionManager is periodically triggered.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF80">
|
|
get_rate
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual ACE_Time_Value& get_rate (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method will return the rate at which the
|
|
cdevSessionManager object is periodically triggered.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF81">
|
|
processMessages
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual void processMessages (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a user defined method that dequeues messages,
|
|
processes them and then enqueues the result.
|
|
</p>
|
|
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
7.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF82">
|
|
Properties of the cdevServer Class
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF83">
|
|
Overview
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The cdevServer class is the developer's primary interface to the server side of the
|
|
CDEV Generic Server Engine. In most cases the developer will only be required to
|
|
overload the processMessages method with his own method that dequeues a
|
|
message, processes it, and then enqueues the result. The cdevServer class has the
|
|
following properties.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF84">
|
|
Attributes of the
|
|
cdevServer Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF85">
|
|
Finished
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
static sig_atomic_t Finished;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This flag is used to indicate that the server should shutdown all
|
|
connections and exit. This is a public flag that may be set by
|
|
signal handlers or by the developer.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF86">
|
|
serverName
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
char * serverName;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the name of the server that was specified when the
|
|
cdevServer object was created. This name will be used to
|
|
identify the server when reporting errors or events.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF87">
|
|
acceptor
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
class ClientAcceptor * acceptor;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the ClientAcceptor class that will be used to listen for
|
|
incoming connections on the specified listening socket.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF88">
|
|
timer
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevNameServerTimer * timer;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a timer object that will be registered with the ACE
|
|
Reactor and will reregister the service with the Name Server
|
|
periodically. If a server does not update its registration with the
|
|
Name Server at least once per minute, the Name Server will
|
|
remove its name from its list of available servers.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF89">
|
|
status
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int status;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
The status variable is set to 0 if the ClientAcceptor was
|
|
successfully opened to listen for incoming connections, or -1 if
|
|
an error occurred while posting the listening socket.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF90">
|
|
Methods of the
|
|
cdevServer Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF91">
|
|
cdevServer
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevServer ( char * Domain, char * Server,
|
|
</p>
|
|
unsigned short Port, double Rate);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is the constructor for the cdevServer class. It will
|
|
register the server with the CDEV Name Server using the
|
|
specified Domain and Server names. It will then post a listening
|
|
socket using a ClientAcceptor object on the specified Port. The
|
|
ACE Reactor will use the rate parameter to establish the
|
|
frequency in seconds in which the processMessages method
|
|
should be called.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF92">
|
|
newClientSession
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
ClientSession * newClientSession ( int SocketID,
|
|
</p>
|
|
int ClientID,
|
|
</p>
|
|
int LocalD);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method overrides the cdevSessionManager's
|
|
newClientSession method and returns a <em>CLIPClientSession</em>
|
|
object. The CLIPClientSession allows the cdevServer object to
|
|
associate the most recent CDEV context received with an
|
|
individual client identifier.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF93">
|
|
newSocketSession
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
SocketSession * newSocketSession (int SocketID);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method overrides the cdevSessionManager's
|
|
newSocketSession method and returns a <em>CLIPSocketSession</em>
|
|
object. The CLIPSocketSession object allows the cdevServer
|
|
object to associate a cdevTagMap object and a
|
|
cdevContextMap object with each socket identifier.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF94">
|
|
dequeue
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int dequeue (cdevMessage * &message);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
Because the cdevServer deals only with the cdevMessage type
|
|
cdevPackets, this method will dispose of any other packet type
|
|
that is received and will return the next available cdevMessage
|
|
object from the inbound queue.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF95">
|
|
decodePacket
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevPacket * decodePacket (cdevPacketBinary * input);
|
|
</p>
|
|
cdevPacket * decodePacket(cdevMessage * message);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
These methods allow the cdevServer class to perform special
|
|
processing whenever a cdevMessage object is dequeued.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF96">
|
|
encodePacket
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevPacketBinary * encodePacket (cdevPacket * input);
|
|
</p>
|
|
cdevPacketBinary * encodePacket(cdevMessage * message);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
These methods allow the cdevServer class to perform special
|
|
processing whenever a cdevMessage object is enqueued.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF97">
|
|
operational
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int operational (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method returns a boolean integer indicating whether or not
|
|
the listening socket has been posted. If the return value is zero,
|
|
then the cdevServer cannot receive new connections.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
8.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF98">
|
|
Properties of the cdevServerInterface Class
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF99">
|
|
Overview
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The cdevServerInterface class is responsible for managing all server connections for
|
|
a specific service on the client side of the connection. In most cases the developer will
|
|
not need to modify any of the code associated with this class. The properties of the
|
|
cdevServerInterface class are described below.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF100">
|
|
Attributes of the
|
|
cdevServer
|
|
Interface Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF101">
|
|
Reactor
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
static ACE_Reactor Reactor;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the ACE Reactor object that is used to respond to input/
|
|
output events on the individual sockets. The developer is
|
|
responsible for calling the poll or pend method periodically in
|
|
order to force events to be handled.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF102">
|
|
connections
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
ServerConnectionList connections;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a list of ServerHandler objects that are used to handle
|
|
input/output events on all currently connected servers.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF103">
|
|
domain
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
char * domain;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the name of the domain in which this
|
|
cdevServerInterface class is operating. When a server name is
|
|
specified, the cdevServerInterface object will poll the Name
|
|
Server for the location of the specified server name within this
|
|
domain.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF104">
|
|
defaultServer
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
char * defaultServer;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the name of the defaultServer to which messages will be
|
|
sent if no other server has been specified. The caller must
|
|
specify the name of the default server by using the "<em>set default</em>"
|
|
message with the server name in the "<em>value</em>" tag of the
|
|
outbound cdevData object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF105">
|
|
defaultServerHandler
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
ServerHandler * defaultServerHandler;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the ServerHandler object for the default server. It is
|
|
maintained separately from the ServerConnectionList in order
|
|
to reduce lookup times when the default server is accessed.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF106">
|
|
maxFd
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int maxFd;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the allocated size of the fdList array.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF107">
|
|
fdList
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int * fdList;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a an array of integers that contains the file descriptors
|
|
that are in use in the ServerHandler objects. The cdevSystem
|
|
object will request this list of integers in order to execute the
|
|
select system call to determine which file descriptors have
|
|
waiting input events.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF108">
|
|
Methods of the
|
|
cdevServer
|
|
Interface Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF109">
|
|
cdevServerInterface
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevServerInterface (char * Domain);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the constructor for the cdevServerInterface class. The
|
|
Domain is the name of the domain that all servers must be
|
|
registered with in the CDEV Name Server.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF110">
|
|
getDefault
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual char * getDefault (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method returns the name of the default server.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF111">
|
|
getDomain
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual char * getDomain (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method returns the name of the default Name Server
|
|
domain.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF112">
|
|
setDefault
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual void setDefault (char * Default);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method allows the caller to set the name of the default
|
|
server. This method will cause the cdevServerInterface to
|
|
attach to the specified server name within the default Name
|
|
Server domain.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF113">
|
|
connect
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual ServerHandler * connect (char * server);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method allows the caller to connect to a specified server
|
|
within the default Name Server domain. Once connected, the
|
|
ServerHandler associated with the connection will be returned
|
|
to the caller. If the server is already connected, its current
|
|
ServerHandler will be returned.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF114">
|
|
disconnect
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual ServerHandler * disconnect (char * server);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method allows the caller to terminate a connection to the
|
|
specified server within the default Name Server domain.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF115">
|
|
enqueue
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int enqueue (ServerHandler *handler, char *binary, size_t len);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method enqueues a binary data stream in the outbound
|
|
queue for the specified ServerHandler. When the
|
|
ServerHandler has reached a high-water mark (or when the
|
|
flush method is called), the data in the outbound queue will be
|
|
written to the socket.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF116">
|
|
getFd
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int getFd (int * &fd, int &numFd);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method allows the cdevSystem object to get the file
|
|
descriptors that are in use by the cdevServerInterface in order
|
|
to poll for read events using the select system call.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF117">
|
|
flush
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int flush (void);
|
|
</p>
|
|
int flush (int fd);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method forces the data in the outbound queues for all
|
|
ServerHandlers (or the specified ServerHandler if the fd
|
|
parameter contains a file descriptor) to be flushed to their
|
|
associated sockets. The system will wait for up to five seconds
|
|
for all outbound data to be written.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF118">
|
|
pend
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int pend (double seconds, int fd = -1);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method calls the handle_events method of the ACE
|
|
Reactor to poll for inbound events. If data is ready on any of the
|
|
supported sockets, then the ServerHandler objects will be
|
|
called to handle the input.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
9.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF119">
|
|
Properties of the cdevClientService Class
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF120">
|
|
Overview
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The cdevClientService class is the class that the developer will directly inherit from in
|
|
order to create his new service. This class inherits most of its functionality from the
|
|
cdevServerInterface class and either inherits or contains all of the methods necessary
|
|
for a CDEV Service. The properties of the cdevClientService class are described
|
|
below.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF121">
|
|
Attributes of the
|
|
cdevClientService
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF122">
|
|
callback
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevCallback callback;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the callback object that is used to support sendNoBlock
|
|
requests because the service implements all operations as
|
|
sendCallback operations. In situations where no callback object
|
|
has been specified, this one is used by default.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF123">
|
|
transactions
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
AddressIndex transactions;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a table that contains a list of all active transaction
|
|
objects. When a transaction is returned from the server, its
|
|
associated transaction object is removed from this list and
|
|
deleted.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF124">
|
|
contexts
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevContextMap contexts;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a table that contains a copy of all contexts that have
|
|
been used by the service. This table is used to allow the
|
|
cdevRequestObjects to maintain an integer identifier for their
|
|
current context and to simplify detection of context changes to
|
|
a specific socket.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF125">
|
|
tagCallback
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevClientTagCallback tagCallback;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a callback object that will be called each time a new tag
|
|
is placed in the cdevGlobalTagTable. This callback causes a
|
|
new copy of the cdevTagMap to be submitted to each server.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF126">
|
|
Methods of the
|
|
cdevClientService
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF127">
|
|
cdevClientService
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevClientService ( char * domain, char * name,
|
|
</p>
|
|
cdevSystem & system =
|
|
</p>
|
|
cdevSystem::defaultSystem());
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the constructor for the cdevClientService object. The
|
|
domain parameter specifies the name of the Name Server
|
|
domain where its servers will be found. The name parameter is
|
|
the name of the service and the system parameter is a
|
|
reference to the cdevSystem object that it will use.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF128">
|
|
defaultCallback
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
static void defaultCallback ( int, void *,
|
|
</p>
|
|
cdevRequestObject &,
|
|
</p>
|
|
cdevData &);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the default callback function that is used by the callback
|
|
attribute for processing sendNoBlock messages.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF129">
|
|
outputError
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int outputError ( int severity, char *name,
|
|
</p>
|
|
char *formatString,...);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used by the class to display error and warning
|
|
messages. This method calls the reportError method of the
|
|
cdevSystem object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF130">
|
|
flush
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int flush (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method causes all messages that are waiting in the
|
|
outbound queues to be flushed to their associated sockets.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF131">
|
|
pend
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int pend (double seconds, int fd = -1);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method causes the service to pend for a specified number
|
|
of seconds and wait for read events on its file descriptors.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF132">
|
|
poll
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int poll (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method causes the service to pend for a very short period
|
|
of time and wait for read events on its file descriptors.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF133">
|
|
pend
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int pend (int fd = -1);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method causes the service to pend until the next read
|
|
event occurs on one of its file descriptors.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF134">
|
|
getNameServer
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int getNameServer (cdevDevice * &ns);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is typically used to return a pointer to a service
|
|
specific local Name Server device. Because this option is not
|
|
currently supported by this service, the ns parameters is set to
|
|
NULL and 0 is returned.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF135">
|
|
getRequestObject
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int getRequestObject ( char * device, char * message,
|
|
</p>
|
|
cdevRequestObject * &req);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used by the cdevSystem object to obtain a
|
|
specific cdevRequestObject associated with the specified
|
|
device and message.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish BODY ***!></p></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF136">
|
|
enqueue
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int enqueue ( char * server, cdevData * in,
|
|
</p>
|
|
cdevTranObj & xobj);
|
|
</p>
|
|
int enqueue ( ServerHandler * handler,
|
|
</p>
|
|
cdevData * in, cdevTranObj & xobj);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
These methods are called by the cdevClientRequestObject to
|
|
enqueue messages to be sent to a specific server. The server
|
|
may be specified either by the server name or by the
|
|
associated ServerHandler object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF137">
|
|
cancel
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int cancel (cdevTranObj & xobj);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This message is used to cancel a transaction that has already
|
|
been sent. Since a transaction cannot be canceled once sent to
|
|
the server, this method simply removes its transaction number
|
|
from the list of transactions and deletes its transaction object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF138">
|
|
enqueue
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int enqueue ( int status, ServerHandler * handler,
|
|
</p>
|
|
char * binary, size_t binaryLen);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is called by the cdevServerInterface to enqueue
|
|
an inbound packet that has been received from a server. The
|
|
status indicates whether the message was successfully sent
|
|
and the ServerHandler indicates the server that the message
|
|
was destined for. This method will call the fireCallback method
|
|
to dispatch the message.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF139">
|
|
fireCallback
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
void fireCallback ( int status, cdevTranObj &xobj,
|
|
</p>
|
|
cdevData *resultData,
|
|
</p>
|
|
int partialTransaction = 0);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method will execute the callback method associated with
|
|
the specified transaction object. If non-zero, the
|
|
partialTransaction flag indicates that the request that is being
|
|
serviced will generate multiple responses.
|
|
</p>
|
|
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
10.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF140">
|
|
Properties of the cdevClientRequestObject Class
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF141">
|
|
Overview
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The cdevClientRequestObject is a cdevRequestObject class that has been optimized
|
|
to operate with the cdevClientService class. The cdevClientRequestObject class has
|
|
the following properties.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF142">
|
|
Attributes of the
|
|
cdevClient
|
|
RequestObject
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF143">
|
|
sendStatus
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
SendStatus sendStatus;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a structure that is used as the user argument to the
|
|
default callback for the cdevClientRequestObject. Whenever a
|
|
<em>send </em>method is executed, the request object can detect that the
|
|
operation has completed by polling this value.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF144">
|
|
server
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
char server [256];
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the name of the server that the
|
|
cdevClientRequestObject is currently connected to. This value
|
|
is maintained in order to reestablish the connection if a
|
|
communication error occurs.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF145">
|
|
DDL_server
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
char DDL_server[256];
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the server name that is specified in the CDEV DDL file
|
|
as the default server for this device/message combination.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF146">
|
|
syncCallback
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevCallback syncCallback;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the callback object that is used to receive the callback
|
|
when the <em>send</em> method is executed. The callback used by this
|
|
method expects to receive a SendStatus structure as its user
|
|
argument.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF147">
|
|
handler
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
ServerHandler * handler;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the ServerHandler object for the server to which the
|
|
cdevClientRequestObject is currently attached.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF148">
|
|
contextID
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int contextID;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the index of the current context from the
|
|
cdevContextMap that is maintained in the service. This
|
|
identifier is used during transmission to determine if the context
|
|
has changed since the last transmission.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF149">
|
|
commandCode
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int commandCode;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is an integer that holds an enumerated type identifying the
|
|
command or verb that the cdevClientRequestObject supports.
|
|
The standard verbs are "get", "set", "monitorOn", and
|
|
"monitorOff".
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF150">
|
|
messageCode
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int messageCode;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is an integer that holds an enumerated type identifying the
|
|
message that the cdevClientRequestObject supports. Typically
|
|
only messages that are intrinisic to the service layer will be
|
|
enumerated here. The following messages are currently
|
|
supported: "get servers", "get default", "set default", and
|
|
"disconnect".
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF151">
|
|
Methods of the
|
|
cdevClient
|
|
RequestObject
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td width=5% valign=top>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF152">
|
|
constructor
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevClientRequestObject ( char * device, char * message,
|
|
</p>
|
|
cdevSystem & system =
|
|
</p>
|
|
cdevSystem::defaultSystem());
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the constructor for the cdevClientRequestObject. It will
|
|
check the CDEV DDL file to determine if a default server has
|
|
been established for this device/message combination.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF153">
|
|
setContext
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int setContext (cdevData & ctx);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used to set the context for the
|
|
cdevClientRequestObject. The context may be used to
|
|
establish the default server that the request object will
|
|
communicate with if the server tag has been set. If the server
|
|
tag is unspecified, then the server specified in the CDEV DDL
|
|
file will be used. If no server has been specified in the CDEV
|
|
DDL file, then the request object will rely on the
|
|
cdevClientService to use the default server.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF154">
|
|
send
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int send (cdevData & in, cdevData & out);
|
|
</p>
|
|
virtual int send (cdevData * in, cdevData & out);
|
|
</p>
|
|
virtual int send (cdevData & in, cdevData * out);
|
|
</p>
|
|
virtual int send (cdevData * in, cdevData * out);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method will synchronously transmit the device/message
|
|
combination to the server. See the setContext method for
|
|
details on how the target server is selected.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF155">
|
|
sendNoBlock
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int sendNoBlock (cdevData & in, cdevData & out);
|
|
</p>
|
|
virtual int sendNoBlock (cdevData * in, cdevData & out);
|
|
</p>
|
|
virtual int sendNoBlock (cdevData & in, cdevData * out);
|
|
</p>
|
|
virtual int sendNoBlock (cdevData * in, cdevData * out);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method will asynchronously transmit the device/message
|
|
combination to the server. The caller is required to poll the
|
|
system in order to allow the transmission to be processed. See
|
|
the setContext method for information on how the target server
|
|
is selected.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF156">
|
|
sendCallback
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int sendCallback (cdevData & in, cdevCallback &);
|
|
</p>
|
|
virtual int sendCallback (cdevData * in, cdevCallback &);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method will asynchronously transmit the device/message
|
|
combination to the server and will call a developer specified
|
|
callback function when the message has been processed. The
|
|
caller is required to poll the system in order to provide time for
|
|
the transmission to be processed. See the setContext method
|
|
for information on how the target server is selected.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF157">
|
|
className
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual const char * className (void) const;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method returns the name of the class.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF158">
|
|
defaultCallback
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
static void defaultCallback ( int status, void * user,
|
|
</p>
|
|
cdevRequestObject &,
|
|
</p>
|
|
cdevData &);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the callback function that will be executed when the
|
|
synchronous send method has been used. It will set the value
|
|
of the SendStatus structure that was passed as its user
|
|
argument to indicate completion and the status of the call.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF159">
|
|
executeServer HandlerCallback
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
|
|
</p>
|
|
virtual void executeServerHandlerCallback (ServerHandler*);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is inherited from the ServerHandlerCallback
|
|
method and will be called by the ServerHandler that is currently
|
|
in use by this request object prior to its destruction. This allows
|
|
the request object to set the pointer to NULL to avoid accessing
|
|
an invalid or deleted data item later.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF160">
|
|
getServerHandler
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
virtual int getServerHandler (ServerHandler ** Handler);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method allows the caller to get a pointer to the
|
|
ServerHandler that is in use by the cdevClientRequestObject.
|
|
When called, this method will check the class parameters and
|
|
attach or reattach to a server if necessary before returning the
|
|
ServerHandler object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF161">
|
|
getContextID
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int getContextID (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method returns the context index that uniquely identifies
|
|
the context that is in use within this cdevClientRequestObject.
|
|
This value is used by the service to determine if the context
|
|
data needs to be retransmitted to the server.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF162">
|
|
getCommandCode
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int getCommandCode (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method returns the command code that identifies the verb
|
|
portion of the message used by this request object. This code
|
|
is used by the service to avoid having to perform string
|
|
comparisons to identify the message content.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF163">
|
|
getMessageCode
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int getMessageCode (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method returns the message code that identifies the
|
|
message in use by this request object. This code is used by the
|
|
service to identify messages that may be processed locally
|
|
rather than being transmitted to the server.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
11.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF164">
|
|
Implementing Monitoring on the cdevServer
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF165">
|
|
Overview
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Monitoring is implemented on the cdevServer by the use of a <strong><em>cdevMonitorTable</strong></em>
|
|
class. This class stores a collection of <strong><em>cdevMonitorNode</strong></em> objects that are represented
|
|
by a device name and its associated attribute name. Within each of the
|
|
cdevMonitorNode objects there is a list of <strong><em>cdevMonitorEntry</strong></em> objects that contain
|
|
information regarding an individual monitor request - this information is stored in the
|
|
form of the cdevMessage object that was used to place the request.
|
|
</p>
|
|
The cdevMonitorTable provides the methods to insert and remove monitors and to
|
|
retrieve the cdevMonitorNode objects that are used by individual device/attribute
|
|
pairs. By using the node directly to trigger monitors, the application can greatly speed
|
|
the delivery of messages when a monitored value changes.
|
|
</p>
|
|
The following object model describes the general structure of the cdevMonitorTable.
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
|
|
Figure 3:
|
|
<a name="LOFREF7">
|
|
General Structure of the cdevMonitorTable
|
|
<AFrame 66>
|
|
</a> <!*** Finish FIGURE ***!></p></em></font>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF166">
|
|
Special Notes
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Because a monitor generates many responses from the request, the service has to be
|
|
able to differentiate it from the transaction that generate a single response. To
|
|
accomodate this, the cdevMonitorTable uses the operationCode member of the
|
|
cdevMessage structure to indicate that the result is one message of many messages
|
|
that may be generated. If the first bit of the operationCode is non-zero, then the
|
|
response is one of many. If the first bit of the operationCode is zero, then this is the
|
|
last response that will be generated by the monitorOn request.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF167">
|
|
Attributes of the
|
|
cdevMonitorTable
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF168">
|
|
monitors
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
StringHash monitors;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a hash table that is hashed on a string representation of
|
|
the device/attribute combination. Each hash entry points to the
|
|
cdevMonitorNode for that specific hash string combination.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF169">
|
|
Methods of the
|
|
cdevMonitorTable
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF170">
|
|
insertMonitor
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int insertMonitor ( cdevMessage * request,
|
|
</p>
|
|
cdevData * data);
|
|
</p>
|
|
int insertMonitor ( cdevMessage * request,
|
|
</p>
|
|
cdevData ** data, size_t dataCnt);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method allows the caller to insert a new monitor for the
|
|
device and attribute that are specified in the cdevMessage
|
|
object. The data that is provided with the call contains the
|
|
current settings for all properties of the device/attribute
|
|
combination and will be used to dispatch the initial callback. If
|
|
the cdevMessage object contains a list of multiple devices, then
|
|
the second insertMonitor method is used to provide an array of
|
|
cdevData objects containing the settings for each device.
|
|
</p>
|
|
The cdevMessage object that is provided to this method
|
|
becomes the property of the cdevMonitorTable and should not
|
|
be accessed again by the caller.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF171">
|
|
removeMonitor
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int removeMonitor (cdevMessage * request);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method allows the caller to remove a monitor that was
|
|
previously installed using the insertMonitor method.
|
|
</p>
|
|
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF172">
|
|
remove ClientMonitors
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int removeClientMonitors(short clientID);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method will remove all monitors that are associated with a
|
|
specific client identifier. This method is typically employed to
|
|
remove all of a client's monitors when it is disconnected.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF173">
|
|
findMonitor
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevMonitorNode * findMonitor ( char * device,
|
|
</p>
|
|
char * attrib);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used to locate the collection of monitors that is
|
|
associated with one device/attribute pair. An object that
|
|
manages the values of that device/attribute pair may use this
|
|
cdevMonitorNode to directly trigger monitors when one or more
|
|
its properties are changed.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF174">
|
|
fireMonitor
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int fireMonitor ( char * device, char * attrib,
|
|
</p>
|
|
char * property, cdevData * data);
|
|
</p>
|
|
int fireMonitor ( char * device, char * attrib,
|
|
</p>
|
|
int property, cdevData * data);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is used to trigger the callbacks for the monitors
|
|
that are associated with the specified device/attribute pair. The
|
|
property that has been changed is provided in the property
|
|
parameter and a list of the current values of all properties
|
|
should be provided in the data parameter. When this method is
|
|
called it will locate all monitors that are triggered by the
|
|
specified property and will use the context associated with the
|
|
monitor to load the desired property values into the outbound
|
|
data object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF175">
|
|
fireCallback
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int fireCallback (cdevMessage * message);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a pure virtual method that the developer must provide.
|
|
This method is called when the cdevMonitorTable has a
|
|
monitor that needs to be dispatched. The data is provided to
|
|
the method in the form of a cdevMessage object which must be
|
|
dispatched to the client using the user provided mechanisms.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF176">
|
|
Attributes of the
|
|
cdevMonitorNode
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF177">
|
|
parent
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
class cdevMonitorTable * parent;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a pointer to the cdevMonitorTable that contains this
|
|
cdevMonitorNode. This pointer will be used to access the user
|
|
defined fireCallback method when a monitor must be
|
|
dispatched.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF178">
|
|
node
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
cdevMonitorEntry * nodes;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a list of all of the monitors that are associated with this
|
|
cdevMonitorNode.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF179">
|
|
hashString
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
char * hashString;
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is a unique string that is composed of the device name
|
|
and attribute that is used to identify this cdevMonitorNode
|
|
within the list of all cdevMonitorNodes that a cdevMonitorTable
|
|
may be managing.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF180">
|
|
Methods of the
|
|
cdevMonitorNode
|
|
Class
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF181">
|
|
fireMonitor
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int fireMonitor (char * property, cdevData * data);
|
|
</p>
|
|
int fireMonitor (int property, cdevData * data);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method is called in order to trigger all monitors that are
|
|
associated with the specified property. When the method is
|
|
called it will walk through the cdevMonitorEntry objects and
|
|
locate each one that is associated with the specified property. It
|
|
will then evaluate the context for that entry and populate the
|
|
outbound data with the appropriate properties before calling
|
|
the fireCallback method of its parent cdevMonitorTable object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF182">
|
|
isMonitored
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_PROTO ***!><font size=+1 color=Black><em>
|
|
int isMonitored (void);
|
|
<!*** Finish FUNC_PROTO ***!></p></em></font>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This method returns a boolean value that indicates if there are
|
|
any active monitors that have been placed on this
|
|
cdevMonitorNode object.
|
|
</p>
|
|
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td valign=top align=right>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
12.
|
|
<!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start HEADING1 ***!><font size=+3 color=Black><strong>
|
|
<a name="TOCREF183">
|
|
VirtualService: A Complex Client/Server Implementation
|
|
</a> <!*** Finish HEADING1 ***!></p></strong></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF184">
|
|
Overview
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The VirtualService example gives the developer a complex illustration of how to create
|
|
a client/server system that provides for getting, setting and monitoring specific
|
|
properties of a virtual device/attribute pair. By examining the source code, the
|
|
developer can also get an understanding of the different approaches used to return
|
|
message completion codes to the client and how to establish and trigger monitors
|
|
using the components that are provided with the distribution.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF185">
|
|
Virtual Server
|
|
Structure
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The server side of the VirtualService example is structured as described in the object
|
|
model below.
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
|
|
Figure 4:
|
|
<a name="LOFREF8">
|
|
Components of the Virtual Server
|
|
<AFrame 74>
|
|
</a> <!*** Finish FIGURE ***!></p></em></font>
|
|
</td></tr>
|
|
<tr><td valign=top>
|
|
<!*** Start UHEADING2 ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF186">
|
|
Virtual Service
|
|
Structure
|
|
</a> <!*** Finish UHEADING2 ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The client side of the VirtualService example is much less complex and inherits
|
|
almost all of its functionality from the cdevClientService class and declares no
|
|
specialized request object class.
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start FIGURE ***!><font size=+0 color=Black><em>
|
|
Figure 5:
|
|
<a name="LOFREF9">
|
|
Components of the Virtual Service
|
|
<AFrame 87>
|
|
</a> <!*** Finish FIGURE ***!></p></em></font>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<! ************************ FILE : cdevGenericServerExample.mif *****************************!>
|
|
<br><hr><br>
|
|
<table width=100%>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF187">
|
|
VirtualAttrib.h
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
The following header file defines the structure of the VirtualAttrib class. A VirtualAttrib object is used to represent a single
|
|
entity within the VirtualServer. Each VirtualAttrib is represented by a device name and an associated attribute. This device/
|
|
attribute pair has a collection of properties that may be read, written to, or monitored. All of these properties are set using
|
|
methods in order to allow the class to ensure that they are set within the specified range and to allow the monitor callbacks to
|
|
be fired when a value changes.
|
|
</p>
|
|
Additionally, helper functions have been added that allow the caller to populate the properties of the VirtualAttrib using a
|
|
cdevData object that contains tagged data items that specify the new values. Other methods allow the caller to read selected
|
|
properties into an outbound cdevData object using a caller specified context.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<br><hr><br>
|
|
<table width=100%>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<AFrame 1>
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
#ifndef _VIRTUAL_ATTRIB_H_
|
|
#define _VIRTUAL_ATTRIB_H_ 1
|
|
|
|
#include <cdevData.h>
|
|
#include <VirtualServer.h>
|
|
|
|
// *****************************************************************************
|
|
// * class VirtualAttrib:
|
|
// * This class maintains a list of items that make-up a Virtual Attrib. And
|
|
// * access mechanisms.
|
|
// *****************************************************************************
|
|
class VirtualAttrib
|
|
{
|
|
private:
|
|
char * device;
|
|
<AFrame 3>
|
|
char * attrib;
|
|
cdevMonitorNode * monitors;
|
|
|
|
double value;
|
|
<AFrame 7>
|
|
char status [255];
|
|
char severity[255];
|
|
char units [255];
|
|
double alarmHigh;
|
|
double alarmLow;
|
|
double warningHigh;
|
|
double warningLow;
|
|
double controlHigh;
|
|
double controlLow;
|
|
int resultCode;
|
|
|
|
public:
|
|
VirtualAttrib (char * Device, char * Attrib);
|
|
~VirtualAttrib ( void );
|
|
|
|
int setFromData ( cdevData * data );
|
|
<AFrame 13>
|
|
void getToData ( cdevData * data, cdevData * context = NULL );
|
|
void getAllToData ( cdevData * data );
|
|
|
|
int setValue ( double Value );
|
|
<AFrame 9>
|
|
int setStatus ( char * Status );
|
|
int setSeverity ( char * Severity );
|
|
int setUnits ( char * Units );
|
|
int setAlarmHigh ( double AlarmHigh );
|
|
int setAlarmLow ( double AlarmLow );
|
|
int setWarningHigh ( double WarningHigh );
|
|
int setWarningLow ( double WarningLow );
|
|
int setControlHigh ( double ControlHigh );
|
|
int setControlLow ( double ControlLow );
|
|
void checkAlarms ( void );
|
|
|
|
double getValue ( void ) { return value; }
|
|
<AFrame 16>
|
|
char * getStatus ( void ) { return status; }
|
|
char * getSeverity ( void ) { return severity; }
|
|
char * getUnits ( void ) { return units; }
|
|
double getAlarmHigh ( void ) { return alarmHigh; }
|
|
double getAlarmLow ( void ) { return alarmLow; }
|
|
double getWarningHigh ( void ) { return warningHigh; }
|
|
double getWarningLow ( void ) { return warningLow; }
|
|
double getControlHigh ( void ) { return controlHigh; }
|
|
double getControlLow ( void ) { return controlLow; }
|
|
int getResultCode ( void ) { return resultCode; }
|
|
|
|
void insertMonitor ( cdevMonitorTable * table, cdevMessage * message );
|
|
<AFrame 20>
|
|
void removeMonitor ( cdevMonitorTable * table, cdevMessage * message );
|
|
};
|
|
|
|
#endif
|
|
|
|
<AFrame 23>
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF188">
|
|
VirtualAttrib.cc
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the source file that defines the implementation details of the VirtualDevice class. The methods below are used to
|
|
insert and retrieve properties associated with the device/attribute pairs that are represented by each VirtualDevice object.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<AFrame 25>
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
#include <VirtualAttrib.h>
|
|
|
|
static int VALUE_TAG = -1;
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
These static integers will be populated with the associated tag identifiers
|
|
that are used in the cdevData object. By using the tag identifier integer
|
|
rather than the associated character string, performance is greatly
|
|
improved when accessing properties stored in the cdevData object.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 27>
|
|
static int STATUS_TAG = -1;
|
|
static int SEVERITY_TAG = -1;
|
|
static int UNITS_TAG = -1;
|
|
static int ALARMHIGH_TAG = -1;
|
|
static int ALARMLOW_TAG = -1;
|
|
static int WARNINGHIGH_TAG = -1;
|
|
static int WARNINGLOW_TAG = -1;
|
|
static int CONTROLHIGH_TAG = -1;
|
|
static int CONTROLLOW_TAG = -1;
|
|
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::VirtualAttrib :
|
|
// * This is the constructor for the VirtualAttrib class. It initializes the
|
|
// * internal mechanisms to 0.
|
|
// *****************************************************************************
|
|
VirtualAttrib::VirtualAttrib ( char * Device, char * Attrib )
|
|
: device(strdup(Device)),
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The constructor for the VirtualAttrib object makes a copy of the name of
|
|
the device and attribute and then initializes all of its internal properties.
|
|
Note that if the 'high' and 'low' values for a range specification (such as
|
|
alarm) are equal, then that range specification is disabled.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 33>
|
|
attrib(strdup(Attrib)),
|
|
monitors(NULL),
|
|
value(0.0),
|
|
alarmHigh(0.0),
|
|
alarmLow(0.0),
|
|
warningHigh(0.0),
|
|
warningLow(0.0),
|
|
controlHigh(0.0),
|
|
controlLow(0.0)
|
|
{
|
|
*severity = 0;
|
|
*units = 0;
|
|
strcpy(status, "NORMAL");
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::~VirtualAttrib :
|
|
// * This is the destructor for the VirtualAttrib class. It must free the
|
|
// * memory associated with the device and attribute names.
|
|
// *****************************************************************************
|
|
VirtualAttrib::~VirtualAttrib ( void
|
|
)
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The destructor for a VirtualAttrib object only needs to delete the device
|
|
and attrib strings that were duplicated when the object was created.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 37>
|
|
{
|
|
delete device;
|
|
delete attrib;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setFromData :
|
|
// * This method will populate the VirtualAttrib object with the data contained in
|
|
// * the cdevData object.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setFromData ( cdevData * data )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
When a "set" cdevMessage
|
|
object is received in the
|
|
processMessages method of
|
|
the VirtualServer, it contains a
|
|
cdevData object that has a list
|
|
of properties and values. For
|
|
each property that is specified
|
|
this method will call the set
|
|
method with the new value. If
|
|
the value is different than the
|
|
previous value and the
|
|
property is monitored, then the
|
|
callback will be fired at that
|
|
time.
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start Body ***!><font size=+2 color=Black>
|
|
|
|
<!*** Finish Body ***!></p></font>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The result of this operation is
|
|
indicated by success in setting
|
|
the value property.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 31>
|
|
{
|
|
double val;
|
|
int result;
|
|
if(data!=NULL)
|
|
{
|
|
result = CDEV_SUCCESS;
|
|
data->get(UNITS_TAG, units, 255);
|
|
if(data->get(CONTROLLOW_TAG, &val)==CDEV_SUCCESS) setControlLow(val);
|
|
if(data->get(CONTROLHIGH_TAG, &val)==CDEV_SUCCESS) setControlHigh(val);
|
|
if(data->get(ALARMLOW_TAG, &val)==CDEV_SUCCESS) setAlarmLow(val);
|
|
if(data->get(ALARMHIGH_TAG, &val)==CDEV_SUCCESS) setAlarmHigh(val);
|
|
if(data->get(WARNINGLOW_TAG, &val)==CDEV_SUCCESS) setWarningLow(val);
|
|
if(data->get(WARNINGHIGH_TAG, &val)==CDEV_SUCCESS) setWarningHigh(val);
|
|
if(data->get(VALUE_TAG, &val)==CDEV_SUCCESS)
|
|
{
|
|
result=setValue(val);
|
|
}
|
|
}
|
|
else result = CDEV_ERROR;
|
|
checkAlarms();
|
|
return result;
|
|
}
|
|
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::getToData :
|
|
// * This method will populate the VirtualAttrib object with the data contained in
|
|
// * the cdevData object.
|
|
// *****************************************************************************
|
|
void VirtualAttrib::getToData ( cdevData * data, cdevData * context )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
When a "get" cdevMessage object is received in the
|
|
processMessages method of the VirtualServer, it
|
|
contains a context that indicates the properties that the
|
|
caller desires to be returned. This method walks through
|
|
the context object and copies each property that is
|
|
specified in the context into the cdevData object pointed
|
|
to by the data parameter. Once populated, this object will
|
|
be returned to the caller.
|
|
</p>
|
|
|
|
</p>
|
|
If the context is empty, then the "value", "status", and
|
|
"severity" properties are returned by default.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 40>
|
|
{
|
|
if(data!=NULL)
|
|
{
|
|
data->remove();
|
|
if(context!=NULL)
|
|
{
|
|
if(context->getType(VALUE_TAG)!=CDEV_INVALID)
|
|
data->insert(VALUE_TAG, getValue());
|
|
if(context->getType(STATUS_TAG)!=CDEV_INVALID)
|
|
data->insert(STATUS_TAG, getStatus());
|
|
if(context->getType(SEVERITY_TAG)!=CDEV_INVALID)
|
|
data->insert(SEVERITY_TAG, getSeverity());
|
|
if(context->getType(UNITS_TAG)!=CDEV_INVALID)
|
|
data->insert(UNITS_TAG, getUnits());
|
|
if(context->getType(CONTROLLOW_TAG)!=CDEV_INVALID)
|
|
data->insert(CONTROLLOW_TAG, getControlLow());
|
|
if(context->getType(CONTROLHIGH_TAG)!=CDEV_INVALID)
|
|
data->insert(CONTROLHIGH_TAG, getControlHigh());
|
|
if(context->getType(ALARMLOW_TAG)!=CDEV_INVALID)
|
|
data->insert(ALARMLOW_TAG, getAlarmLow());
|
|
if(context->getType(ALARMHIGH_TAG)!=CDEV_INVALID)
|
|
data->insert(ALARMHIGH_TAG, getAlarmHigh());
|
|
if(context->getType(WARNINGLOW_TAG)!=CDEV_INVALID)
|
|
data->insert(WARNINGLOW_TAG, getWarningLow());
|
|
if(context->getType(WARNINGHIGH_TAG)!=CDEV_INVALID)
|
|
data->insert(WARNINGHIGH_TAG, getWarningHigh());
|
|
}
|
|
else
|
|
{
|
|
data->insert(VALUE_TAG, getValue());
|
|
data->insert(STATUS_TAG, getStatus());
|
|
data->insert(SEVERITY_TAG, getSeverity());
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::getAllToData :
|
|
// * This method will populate the VirtualAttrib object with the data contained in
|
|
// * the cdevData object.
|
|
// *****************************************************************************
|
|
void VirtualAttrib::getAllToData ( cdevData * data )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Unlike the getToData method, this method will populate
|
|
the cdevData object will all properties that are currently
|
|
contained in the VirtualAttrib object.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 42>
|
|
{
|
|
if(data!=NULL)
|
|
{
|
|
data->remove();
|
|
data->insert(VALUE_TAG, getValue());
|
|
data->insert(STATUS_TAG, getStatus());
|
|
data->insert(SEVERITY_TAG, getSeverity());
|
|
data->insert(UNITS_TAG, getUnits());
|
|
data->insert(CONTROLLOW_TAG, getControlLow());
|
|
data->insert(CONTROLHIGH_TAG, getControlHigh());
|
|
data->insert(ALARMLOW_TAG, getAlarmLow());
|
|
data->insert(ALARMHIGH_TAG, getAlarmHigh());
|
|
data->insert(WARNINGLOW_TAG, getWarningLow());
|
|
data->insert(WARNINGHIGH_TAG, getWarningHigh());
|
|
}
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setValue :
|
|
// * This method allows the caller to set the value of the Virtual Attrib.
|
|
// * This call will fail if the specified value is outside of the legal
|
|
// * range.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setValue ( double Value )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The setValue method is used to set the value property within the VirtualAttrib
|
|
object. Since the overall range may be specified using the controlHigh and
|
|
controlLow properties, this method will ensure that the new value conforms to the
|
|
range (if specified) and will fail if the value is too high or too low.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 44>
|
|
{
|
|
resultCode = CDEV_SUCCESS;
|
|
|
|
if(controlHigh>controlLow &&
|
|
(Value<controlLow || Value>controlHigh))
|
|
{
|
|
resultCode = CDEV_OUTOFRANGE;
|
|
}
|
|
else if(value != Value)
|
|
{
|
|
value = Value;
|
|
checkAlarms();
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The checkAlarms method is called after the value has been set. The
|
|
checkAlarms method determines if the new value places the VirtualAttrib
|
|
in a warning or alarm state based on the confines that are specified in the
|
|
alarmHigh/Low and warningHigh/Low properties.
|
|
</p>
|
|
If the VirtualAttrib is monitored, then all properties will be copied into a
|
|
cdevData object and the list of monitors for the value property will be fired.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 46>
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(VALUE_TAG, &data);
|
|
}
|
|
}
|
|
return resultCode;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setStatus :
|
|
// * This method allows the caller to set the status of the device.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setStatus ( char * Status )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Sets the status property and fires any monitors that may be associated
|
|
with that value.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 48>
|
|
{
|
|
if(strcmp(status, Status))
|
|
{
|
|
strncpy(status, Status, 255);
|
|
status[254] = 0;
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(STATUS_TAG, &data);
|
|
}
|
|
}
|
|
return CDEV_SUCCESS;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setSeverity :
|
|
// * This method allows the caller to set the severity flag for the device.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setSeverity ( char * Severity )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Sets the severity property and fires any monitors that may be associated
|
|
with that value.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 50>
|
|
{
|
|
if(strcmp(severity, Severity))
|
|
{
|
|
strncpy(severity, Severity, 255);
|
|
severity[254] = 0;
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(SEVERITY_TAG, &data);
|
|
}
|
|
}
|
|
return CDEV_SUCCESS;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setUnits :
|
|
// * This method allows the caller to set the units for the device.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setUnits ( char * Units )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Sets the units property and fires any monitors that may be associated with
|
|
that value.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 52>
|
|
{
|
|
if(strcmp(units, Units))
|
|
{
|
|
strncpy(units, Units, 255);
|
|
units[254] = 0;
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(UNITS_TAG, &data);
|
|
}
|
|
}
|
|
return CDEV_SUCCESS;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setAlarmHigh :
|
|
// * This method allows the caller to set the high alarm value of the device.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setAlarmHigh ( double AlarmHigh )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Sets the alarmHigh property and calls checkAlarms to determine if a
|
|
change in this value will trigger a change in the device alarm status.
|
|
Dispatches any monitors that are associated with the property.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 54>
|
|
{
|
|
if(alarmHigh!=AlarmHigh)
|
|
{
|
|
alarmHigh = AlarmHigh;
|
|
checkAlarms();
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(ALARMHIGH_TAG, &data);
|
|
}
|
|
}
|
|
return CDEV_SUCCESS;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setAlarmLow :
|
|
// * This method allows the caller to set the low alarm value of the device.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setAlarmLow ( double AlarmLow )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Sets the alarmLow property and calls checkAlarms to determine if a
|
|
change in this value will trigger a change in the device alarm status.
|
|
Dispatches any monitors that are associated with the property.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 56>
|
|
{
|
|
if(alarmLow!=AlarmLow)
|
|
{
|
|
alarmLow = AlarmLow;
|
|
checkAlarms();
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(ALARMLOW_TAG, &data);
|
|
}
|
|
}
|
|
return CDEV_SUCCESS;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setWarningHigh :
|
|
// * This method allows the caller to set the high warning value of a device.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setWarningHigh ( double WarningHigh
|
|
)
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Sets the warningHigh property and calls checkAlarms to determine if a
|
|
change in this value will trigger a change in the device warning status.
|
|
Dispatches any monitors that are associated with the property.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 58>
|
|
{
|
|
if(warningHigh!=WarningHigh)
|
|
{
|
|
warningHigh = WarningHigh;
|
|
checkAlarms();
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(WARNINGHIGH_TAG, &data);
|
|
}
|
|
}
|
|
return CDEV_SUCCESS;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setWarningLow :
|
|
// * This method allows the caller to set the low warning value of a device.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setWarningLow ( double WarningLow )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Sets the warningLow property and calls checkAlarms to determine if a
|
|
change in this value will trigger a change in the device warning status.
|
|
Dispatches any monitors that are associated with the property.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 60>
|
|
{
|
|
if(warningLow != WarningLow)
|
|
{
|
|
warningLow = WarningLow;
|
|
checkAlarms();
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(WARNINGLOW_TAG, &data);
|
|
}
|
|
}
|
|
return CDEV_SUCCESS;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setControlHigh :
|
|
// * This method allows the caller to set the maximum value for a device.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setControlHigh ( double ControlHigh )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Sets the controlHigh property and calls checkAlarms to determine if a
|
|
change in this value will trigger a change in the device status.
|
|
Dispatches any monitors that are associated with the property.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 62>
|
|
{
|
|
if(controlHigh != ControlHigh)
|
|
{
|
|
controlHigh = ControlHigh;
|
|
checkAlarms();
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(CONTROLHIGH_TAG, &data);
|
|
}
|
|
}
|
|
return CDEV_SUCCESS;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::setControlLow :
|
|
// * This method allows the caller to set the minimum value of a device.
|
|
// *****************************************************************************
|
|
int VirtualAttrib::setControlLow ( double ControlLow )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Sets the controlLow property and calls checkAlarms to determine if a
|
|
change in this value will trigger a change in the device status.
|
|
Dispatches any monitors that are associated with the property.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 64>
|
|
{
|
|
if(controlLow != ControlLow)
|
|
{
|
|
controlLow = ControlLow;
|
|
checkAlarms();
|
|
if(monitors && monitors->isMonitored())
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
monitors->fireMonitor(CONTROLLOW_TAG, &data);
|
|
}
|
|
}
|
|
return CDEV_SUCCESS;
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::checkAlarms :
|
|
// * This method allows the caller to read the value in comparison with all
|
|
// * of its limits and set the status and severity tag appropriately.
|
|
// *****************************************************************************
|
|
void VirtualAttrib::checkAlarms ( void )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
This method tests the value property against the ranges that may be
|
|
specified in the warningHigh/Low, alarmHigh/Low and controlHigh/Low
|
|
properties. If the value is outside of any of these ranges, then the status
|
|
and severity variables will be set to a corresponding value: "WARNING",
|
|
"ALARM", or "ERROR"
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 66>
|
|
{
|
|
int done = 0;
|
|
if(controlHigh>controlLow)
|
|
{
|
|
{
|
|
setStatus("OUT OF RANGE LOW");
|
|
setSeverity("ERROR");
|
|
done = 1;
|
|
}
|
|
else if (value>controlHigh)
|
|
{
|
|
setStatus("OUT OF RANGE HIGH");
|
|
setSeverity("ERROR");
|
|
done = 1;
|
|
}
|
|
}
|
|
if(!done && alarmHigh>alarmLow)
|
|
{
|
|
{
|
|
setStatus("ALARM LOW");
|
|
setSeverity("ALARM");
|
|
done = 1;
|
|
}
|
|
else if (value>alarmHigh)
|
|
{
|
|
setStatus("ALARM HIGH");
|
|
setSeverity("ALARM");
|
|
done = 1;
|
|
}
|
|
}
|
|
if(!done && warningHigh>warningLow)
|
|
{
|
|
{
|
|
setStatus("WARNING LOW");
|
|
setSeverity("WARNING");
|
|
done = 1;
|
|
}
|
|
else if (value>warningHigh)
|
|
{
|
|
setStatus("WARNING HIGH");
|
|
setSeverity("WARNING");
|
|
done = 1;
|
|
}
|
|
}
|
|
if(!done)
|
|
{
|
|
setStatus("NORMAL");
|
|
setSeverity("\\0");
|
|
}
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::insertMonitor :
|
|
// * This message adds a monitor to the cdevMonitorTable for this device/
|
|
// * attribute pair. The message parameter becomes the property of the
|
|
// * monitorTable and should not be accessed again by the caller.
|
|
// *****************************************************************************
|
|
void VirtualAttrib::insertMonitor ( cdevMonitorTable * table, cdevMessage * message )
|
|
{
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The processMessages method of the VirtualServer class
|
|
calls this method when it receives a "monitorOn" message.
|
|
This method collects all of the current property values into a
|
|
cdevData object and then submits the cdevMessage object
|
|
and the data to the insertMonitor method of the
|
|
cdevMonitorTable object. The method will then call
|
|
findMonitor to locate its node in the cdevMonitorTable for later
|
|
access.
|
|
</p>
|
|
Note that the cdevMessage object becomes the property of
|
|
the cdevMonitorTable object and should not be accessed
|
|
again.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 68>
|
|
if(table!=NULL && message!=NULL)
|
|
{
|
|
cdevData data;
|
|
getAllToData(&data);
|
|
table->insertMonitor(message, &data);
|
|
monitors = table->findMonitor(device, attrib);
|
|
if(monitors && !monitors->isMonitored()) monitors = NULL;
|
|
}
|
|
else if(message!=NULL) delete message;
|
|
}
|
|
|
|
|
|
|
|
|
|
// *****************************************************************************
|
|
// * VirtualAttrib::removeMonitor:
|
|
// * This method uses the cancelTransIdx to locate and delete a monitor
|
|
// * that was previously posted using that transaction index.
|
|
// *****************************************************************************
|
|
void VirtualAttrib::removeMonitor (cdevMonitorTable * table, cdevMessage * message )
|
|
{
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The processMessages method of the VirtualServer class
|
|
calls this method when it receives a "monitorOff" message.
|
|
The method will call the removeMonitor method of the
|
|
cdevMonitorTable to remove the monitor.
|
|
</p>
|
|
If all monitors have been removed that are associated with
|
|
this VirtualAttrib object, then the monitors pointer will be set
|
|
to NULL.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 70>
|
|
if(table!=NULL && message!=NULL)
|
|
{
|
|
table->removeMonitor(message);
|
|
if(monitors && !monitors->isMonitored()) monitors = NULL;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
<AFrame 5>
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF189">
|
|
VirtualServer.h
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
The following header file defines the structure of the VirtualServer class. The VirtualServer class inherits its functionality from
|
|
the cdevServer object and consequently has to do very little initialization. When created it calls the populateTable method to
|
|
generate a list of VirtualAttrib objects that it will support, the service may then manipulate any of the devices that the server
|
|
has created using the commands "get", "set", "monitorOn", and "monitorOff".
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<AFrame 72>
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
#include <cdevServer.h>
|
|
#include <StringHash.h>
|
|
#include <cdevMonitorTable.h>
|
|
// *****************************************************************************
|
|
// * class VirtualServer :
|
|
// * This is the server class for the VirtualDevice. It simply receives
|
|
// * messages from a client and immediately returns them.
|
|
// *
|
|
// * The constructor passes the domain, server, port and rate to the
|
|
// * underlying cdevServer class to be processed. The cdevServer constructor
|
|
// * will add this server to the Name Server and will begin processing
|
|
// * messages when the cdevServer::runServer() method is executed.
|
|
// *
|
|
// * The processMessages method is the servers interface to the world... Each
|
|
// * time a complete message is received or the time specified in rate
|
|
// * expires, that method will be called.
|
|
// *****************************************************************************
|
|
class VirtualServer : public cdevServer, public cdevMonitorTable
|
|
{
|
|
private:
|
|
StringHash attribHash;
|
|
public:
|
|
VirtualServer ( char * domain, char * server, unsigned int port, double rate )
|
|
: cdevServer(domain, server, port, rate), attribHash()
|
|
{
|
|
populateTable();
|
|
}
|
|
virtual ~VirtualServer ( void );
|
|
virtual void processMessages ( void );
|
|
void populateTable ( void );
|
|
virtual int fireCallback ( cdevMessage * message );
|
|
};
|
|
|
|
<AFrame 74>
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF190">
|
|
VirtualServer.cc
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This source file implements the classes that are defined in the VirtualServer.h header file. The methods that are contained in
|
|
this file define the functionality for the VirtualServer that is different from what is provided by default by the cdevServer class.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<AFrame 76>
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
#include <VirtualServer.h>
|
|
#include <VirtualAttrib.h>
|
|
|
|
VirtualServer::~VirtualServer ( void )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
This is the destructor for the VirtualServer object. It is responsible for
|
|
walking through the list of VirtualAttrib objects that were created and
|
|
deleting each of them from the list prior to terminating.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 78>
|
|
{
|
|
StringHashIterator iter(&attribHash);
|
|
VirtualAttrib * attrib = NULL;
|
|
char * key = NULL;
|
|
|
|
iter.first();
|
|
while((key=iter.key())!=NULL)
|
|
{
|
|
attrib = (VirtualAttrib *)iter.data();
|
|
iter++;
|
|
attribHash.remove(key);
|
|
if(attrib!=NULL) delete attrib;
|
|
}
|
|
}
|
|
|
|
|
|
void VirtualServer::populateTable ( void )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The populateTable method is used to generate a collection of device
|
|
names and their associated attributes that will be used to create a hash
|
|
table of VirtualAttrib objects. The device names are "device0" through
|
|
"device9", and each device has attributes "attrib0" through "attrib9".
|
|
</p>
|
|
The client may use the "get", "set", "monitorOn" or "monitorOff" methods
|
|
to manipulate the properties associated with any of these VirtualAttrib
|
|
objects.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 80>
|
|
{
|
|
char device[10];
|
|
char attrib[10];
|
|
char key[20];
|
|
{
|
|
{
|
|
sprintf(device, "device%i", i);
|
|
sprintf(attrib, "attrib%i", j);
|
|
sprintf(key, "device%i attrib%i", i, j);
|
|
attribHash.insert(key, new VirtualAttrib(device, attrib));
|
|
}
|
|
}
|
|
}
|
|
|
|
void VirtualServer::processMessages ( void )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The processMessages method will be called whenever data is waiting to
|
|
be processed in the inbound queue. When called, this method should
|
|
process all of the messages that it has available and then return 0.
|
|
</p>
|
|
To process a cdevMessage the method must dequeue it, process it,
|
|
enqueue the result and then delete the original cdevMessage object.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 82>
|
|
{
|
|
char key[255];
|
|
int saveMessageFlag;
|
|
int sendMessageFlag;
|
|
cdevMessage * message;
|
|
VirtualAttrib * attrib;
|
|
cdevData output;
|
|
|
|
while(dequeue(message)==0)
|
|
{
|
|
// *************************************************************
|
|
// * Note at this point a cdevTagMap has already been received
|
|
// * from the client. This tag map will have initialized all
|
|
// * of the tags that are required by the service.
|
|
// *************************************************************
|
|
if(!strcmp(message->getMessage(), "unregister"))
|
|
{
|
|
sendMessageFlag = 0;
|
|
removeClientMonitors(message->getClientID());
|
|
}
|
|
if(!strncmp(message->getMessage(), "get ", 4))
|
|
{
|
|
output.remove();
|
|
saveMessageFlag = 0;
|
|
sendMessageFlag = 1;
|
|
|
|
sprintf(key, "%s %s",
|
|
message->getDeviceList()[0],
|
|
&message->getMessage()[4]);
|
|
|
|
if((attrib = (VirtualAttrib *)attribHash.find(key))!=NULL)
|
|
{
|
|
attrib->getToData(&output, message->getContext());
|
|
output.insert("resultCode", CDEV_SUCCESS);
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The resultCode property is set to CDEV_SUCCESS
|
|
to indicate that the call completed successfully.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 90>
|
|
}
|
|
else output.insert("resultCode", CDEV_NOTFOUND);
|
|
}
|
|
else if(!strncmp(message->getMessage(), "set ", 4))
|
|
{
|
|
output.remove();
|
|
saveMessageFlag = 0;
|
|
sendMessageFlag = 1;
|
|
|
|
sprintf(key, "%s %s",
|
|
message->getDeviceList()[0],
|
|
&message->getMessage()[4]);
|
|
|
|
|
|
if((attrib = (VirtualAttrib *)attribHash.find(key))!=NULL)
|
|
{
|
|
output.insert("resultCode",
|
|
attrib->setFromData(message->getData()));
|
|
}
|
|
else output.insert("resultCode", CDEV_NOTFOUND);
|
|
}
|
|
else if(!strncmp(message->getMessage(), "monitorOn ", 10))
|
|
{
|
|
saveMessageFlag = 1;
|
|
sendMessageFlag = 0;
|
|
|
|
sprintf(key, "%s %s",
|
|
message->getDeviceList()[0],
|
|
&message->getMessage()[10]);
|
|
|
|
if((attrib = (VirtualAttrib *)attribHash.find(key))!=NULL)
|
|
{
|
|
attrib->insertMonitor(this, message);
|
|
}
|
|
}
|
|
else if(!strncmp(message->getMessage(), "monitorOff ", 11))
|
|
{
|
|
saveMessageFlag = 0;
|
|
sendMessageFlag = 1;
|
|
|
|
sprintf(key, "%s %s",
|
|
message->getDeviceList()[0],
|
|
&message->getMessage()[11]);
|
|
|
|
if((attrib = (VirtualAttrib *)attribHash.find(key))!=NULL)
|
|
{
|
|
attrib->removeMonitor(this, message);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
saveMessageFlag = 0;
|
|
sendMessageFlag = 1;
|
|
output.insert("resultCode", CDEV_NOTFOUND);
|
|
}
|
|
|
|
if(sendMessageFlag)
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The sendMessageFlag indicates whether a return message should be provided to the
|
|
caller. If the message was a monitorOn request, then the return message has already
|
|
been automatically dispatched by the cdevMonitorTable object.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 96>
|
|
{
|
|
message->setData(&output, 1);
|
|
enqueue(message);
|
|
}
|
|
if(!saveMessageFlag) delete message;
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
If the cdevMessage object was not provided to the cdevMonitorTable to install a monitor,
|
|
then it should be deleted.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 98>
|
|
}
|
|
}
|
|
|
|
|
|
int VirtualServer::fireCallback ( cdevMessage * message )
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
This method is called by the cdevMonitorTable portion of the class
|
|
whenever a monitored value has changed. It is only required to enqueue
|
|
the cdevMessage object so that it can be returned to the client with the
|
|
new value.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 100>
|
|
{
|
|
int result = CDEV_SUCCESS;
|
|
cdevData * data = NULL;
|
|
|
|
if(message && (data = message->getData())!=NULL)
|
|
{
|
|
data->insert("resultCode", CDEV_SUCCESS);
|
|
result = enqueue(message);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
void main()
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The main function creates an instance of the VirtualServer class named
|
|
"TestServerX", which will have the Name Server domain "VIRTUAL" and
|
|
will listen for incoming requests on port 9120. The processMessages
|
|
method will be called automatically at least every 60 seconds.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 102>
|
|
{
|
|
VirtualServer server("VIRTUAL", "TestServerX", 9120, 60);
|
|
cdevServer::runServer();
|
|
}
|
|
|
|
|
|
<AFrame 104>
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF191">
|
|
VirtualService.h
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
The VirtualService.h header file describes the structure of the VirtualService that will be loaded by the cdevSystem in order
|
|
to accomodate requests made to the VirtualServer.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<AFrame 106>
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
#include <cdevClientService.h>
|
|
|
|
// *****************************************************************************
|
|
// * newVirtualService :
|
|
// * This function will be called by the cdevSystem object to create an
|
|
// * initial instance of the VirtualService.
|
|
// *****************************************************************************
|
|
extern "C" cdevService * newVirtualService ( char * name, cdevSystem * system );
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The newVirtualService function will
|
|
create the initial instance of the
|
|
VirtualService class.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 108>
|
|
|
|
// *****************************************************************************
|
|
// * class VirtualService :
|
|
// * This class simply inherits from the cdevClientService and must define
|
|
// * only a constructor and destructor.
|
|
// *****************************************************************************
|
|
class VirtualService : public cdevClientService
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The VirtualService class inherits
|
|
almost all of its functionality from the
|
|
cdevClientService class.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 110>
|
|
{
|
|
public:
|
|
VirtualService ( char * name, cdevSystem & system =
|
|
cdevSystem::defaultSystem());
|
|
|
|
protected:
|
|
int RESULT_CODE_TAG;
|
|
|
|
virtual ~VirtualService ( void ) {};
|
|
virtual void fireCallback ( int status, cdevTranObj &xobj, cdevData *resultData );
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The fireCallback method has been
|
|
overloaded in order to allow the
|
|
service to copy the resultCode
|
|
property from the returned
|
|
cdevData object into the
|
|
completion status for the
|
|
cdevCallback function.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 112>
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</strong><font size=+1><strong><font size=+0>
|
|
<AFrame 114>
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF192">
|
|
VirtualService.cc
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This source file implements the classes that are defined in the VirtualService.h header file. The methods that are contained
|
|
in this file define the functionality for the VirtualService that is different from what is provided by default by the
|
|
cdevClientService class.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<AFrame 116>
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
#include <VirtualService.h>
|
|
|
|
// *****************************************************************************
|
|
// * newVirtualService:
|
|
// * This function will be called by the cdevSystem object to create an
|
|
// * initial instance of the VirtualService.
|
|
// *****************************************************************************
|
|
extern "C" cdevService * newVirtualService (char * name, cdevSystem * system)
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The newVirtualService is called by the
|
|
cdevSystem to create an instance of
|
|
the VirtualService object.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 118>
|
|
{
|
|
return new VirtualService(name, *system);
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualService::VirtualService :
|
|
// * This is teh constructor for the VirtualService. It initializes the
|
|
// * underlying cdevClientService by specifying that it is in the domain of
|
|
// * VIRTUAL.
|
|
// *****************************************************************************
|
|
VirtualService::VirtualService ( char * name, cdevSystem & system)
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
The constructor for the class will
|
|
initialize the underlying
|
|
cdevClientService object with the
|
|
name of the Name Server domain and
|
|
the service name and cdevSystem
|
|
parameters.
|
|
</p>
|
|
Additionally the constructor must
|
|
declare any tags that it will be using for
|
|
communications.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 120>
|
|
: cdevClientService("VIRTUAL", name, system)
|
|
{
|
|
// *********************************************************************
|
|
// * Install the RESULT_CODE_TAG at a location of 30 or higher if it
|
|
// * does not already exist.
|
|
// *********************************************************************
|
|
RESULT_CODE_TAG = 0;
|
|
cdevData::tagC2I("resultCode", &RESULT_CODE_TAG);
|
|
|
|
{
|
|
cdevData::insertTag(i, "resultCode");
|
|
cdevData::tagC2I("resultCode", &RESULT_CODE_TAG);
|
|
}
|
|
|
|
system.reportError(CDEV_SEVERITY_INFO, "VirtualService", NULL,
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Once initialized the VirtualService will
|
|
declare its presence using the
|
|
reportError mechanism.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 122>
|
|
"Constructing a new VirtualService");
|
|
|
|
}
|
|
|
|
// *****************************************************************************
|
|
// * VirtualService::fireCallback :
|
|
// * This is the method that will be called to dispatch the callback methods
|
|
// * that are associated with the calls to the Virtual Server. If the
|
|
// * message has been processed successfully, then the method will remove
|
|
// * the resultCode from the outbound data and use that as the status.
|
|
// *****************************************************************************
|
|
void VirtualService::fireCallback ( int status, cdevTranObj &xobj, cdevData *resultData )
|
|
{
|
|
// *********************************************************************
|
|
// * If the message was transmitted successfully, get the result code
|
|
// * from the data that was returned and use that as the status.
|
|
// *********************************************************************
|
|
if(status==CDEV_SUCCESS && resultData!=NULL)
|
|
<table border=1><tr><td>
|
|
<table>
|
|
<tr><td>
|
|
<! ***** Empty Column ***** !>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
Before calling the user defined
|
|
callback, this method will copy the
|
|
resultCode property of the returned
|
|
cdevData object into the status integer
|
|
that is provided to the callback
|
|
function.
|
|
<!*** Finish BODY ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
</tr></td></table>
|
|
<AFrame 124>
|
|
{
|
|
resultData->get(RESULT_CODE_TAG, &status);
|
|
resultData->remove(RESULT_CODE_TAG);
|
|
}
|
|
|
|
cdevClientService::fireCallback(status, xobj, resultData);
|
|
}
|
|
|
|
<AFrame 126>
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
<table>
|
|
<tr><td valign=top>
|
|
<!*** Start FUNC_NAME ***!><font size=+1 color=Black><strong>
|
|
<a name="TOCREF193">
|
|
Virtual.ddl
|
|
</a> <!*** Finish FUNC_NAME ***!></p></strong></font>
|
|
</td>
|
|
<td valign=top>
|
|
<!*** Start FUNC_DEF ***!><font size=+1 color=Black>
|
|
This is the device definition file that is used to map the CDEV requests to the VirtualService for transmission to the
|
|
VirtualServer.
|
|
<!*** Finish FUNC_DEF ***!></p></font>
|
|
</td></tr>
|
|
</table>
|
|
<!*** Start BODY ***!><font size=+1 color=Black>
|
|
|
|
<AFrame 128>
|
|
<!*** Finish BODY ***!></p></font>
|
|
<!*** Start SOURCE ***!><pre><font size=+0 color=Black><strong>
|
|
service Virtual
|
|
{
|
|
tags {server}
|
|
}
|
|
|
|
class Virtuals
|
|
{
|
|
verbs {get, set, monitorOn, monitorOff}
|
|
attributes
|
|
{
|
|
default Virtual;
|
|
servers Virtual;
|
|
attrib0 Virtual {server=TestServerX};
|
|
attrib1 Virtual {server=TestServerX};
|
|
attrib2 Virtual {server=TestServerX};
|
|
attrib3 Virtual {server=TestServerX};
|
|
attrib4 Virtual {server=TestServerX};
|
|
attrib5 Virtual {server=TestServerX};
|
|
attrib6 Virtual {server=TestServerX};
|
|
attrib7 Virtual {server=TestServerX};
|
|
attrib8 Virtual {server=TestServerX};
|
|
attrib9 Virtual {server=TestServerX};
|
|
}
|
|
messages
|
|
{
|
|
disconnect Virtual;
|
|
}
|
|
}
|
|
|
|
|
|
Virtuals :
|
|
device0, device1, device2, device3, device4,
|
|
device5, device6, device7, device8, device9;
|
|
</strong><font size=+1><strong><font size=+0>
|
|
<AFrame 130>
|
|
<!*** Finish SOURCE ***!></strong></font></pre>
|
|
</td></tr>
|
|
</table>
|
|
</body>
|