Adic Server Uživatelský manuál Strana 193

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 218
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 192
Response Technique 5-21
21 Dec 2001
Response Technique
This section describes the most desirable response processing
technique.
Setup
The following code should be executed upon startup. This
code installs a signal handler, which will be automatically run
every time one of the child processes terminates. At this point
retrieve the results, place them into internal data structures
and free the shared memory array entry. See Figure 5-21.
Figure 5-21 Setup Signal Handler
. . .
/* dasadmin sample application, dasadmin.c file */
int ( *func )();
struct sigaction action;
aci_async_entry *async_entry;
action.sa_handler = wait_for_child;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
if (sigaction(SIGCHLD, &action, (struct sigaction*)0)
== (int)SIG_ERR)
{
fprintf( stderr, "Unable to set signal handler for
SIGCHLD\n");
return( 1 );
}
. . .
Zobrazit stránku 192
1 2 ... 188 189 190 191 192 193 194 195 196 197 198 ... 217 218

Komentáře k této Příručce

Žádné komentáře