Navigation


Changeset 235:8773740401a5 in freeDiameter for extensions/test_app


Ignore:
Timestamp:
Mar 5, 2010, 7:01:48 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Centralized signal handlers management in the library

Location:
extensions/test_app
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/test_app/CMakeLists.txt

    r120 r235  
    1414        ta_conf.tab.c
    1515        ta_conf.tab.h
    16         ta_sig.c
    1716        ta_dict.c
    1817        ta_cli.c
  • extensions/test_app/ta_cli.c

    r203 r235  
    136136
    137137/* Create a test message */
    138 static void ta_cli_test_message(void)
     138static void ta_cli_test_message(int sig)
    139139{
    140140        struct msg * req = NULL;
     
    236236        CHECK_FCT( fd_sess_handler_create(&ta_cli_reg, free) );
    237237       
    238         CHECK_FCT( ta_sig_init(ta_cli_test_message) );
     238        CHECK_FCT( fd_sig_register(ta_conf->signal, "test_app.cli", ta_cli_test_message ) );
    239239       
    240240        return 0;
     
    243243void ta_cli_fini(void)
    244244{
    245         ta_sig_fini();
    246        
    247         (void) fd_sess_handler_destroy(&ta_cli_reg);
     245        CHECK_FCT_DO( fd_sig_unregister(ta_conf->signal), /* continue */ );
     246       
     247        CHECK_FCT_DO( fd_sess_handler_destroy(&ta_cli_reg), /* continue */ );
    248248       
    249249        return;
  • extensions/test_app/test_app.c

    r120 r235  
    3939
    4040#include "test_app.h"
    41 #include <signal.h>
    4241
    4342/* Initialize the configuration */
  • extensions/test_app/test_app.h

    r127 r235  
    4242 
    4343#include <freeDiameter/extension.h>
     44#include <signal.h>
    4445
    4546#ifndef TEST_APP_DEFAULT_SIGNAL
     
    6970int ta_conf_handle(char * conffile);
    7071
    71 /* Start or stop the signal handler */
    72 int ta_sig_init(void (*cb)(void));
    73 void ta_sig_fini(void);
    74 
    7572/* Handle incoming messages (server) */
    7673int ta_serv_init(void);
Note: See TracChangeset for help on using the changeset viewer.