source: trunk/NAMES_COM/names_extern.c

Last change on this file was 16986, checked in by westram, 7 years ago

Update: continued by [17178]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 715 bytes
Line 
1#include <cstdio>
2#include <cstdlib>
3#include "names_server.h"
4
5struct sigcontext;
6#include "C/server.h"
7
8#include <aisc_server_proto.h>
9#include <aisc_server_extern.h>
10#include <import_proto.h>
11
12extern AN_main *aisc_main;
13int names_server_save();
14
15int names_destroy_locs(AN_local *THIS) {
16    // called when client closes connection
17    destroy_AN_local(THIS);
18    if (aisc_main->ploc_st.cnt <= 0) { // last client disconnected
19        names_server_save();
20    }
21    return 0;
22}
23
24int names_init_socket(AN_local *THIS) {
25    aisc_add_destroy_callback(AISC_CASTSIG(aisc_destroy_callback, names_destroy_locs), (long)THIS);
26    return 0;
27}
28void names_destroy_socket(AN_local *) {
29    aisc_remove_destroy_callback();
30}
Note: See TracBrowser for help on using the repository browser.