source: tags/ms_r16q2/NAMES_COM/names_extern.c

Last change on this file was 8744, checked in by westram, 12 years ago
  • AISC clients
    • client-handles for server-side objects are distinguishable types now (esp. can no longer be confounded w/o compiler messages)
    • main server object has to be passed to aisc_close
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 748 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;
13void names_server_shutdown() __ATTR__NORETURN;
14int names_server_save();
15
16int names_destroy_locs(AN_local *THIS) {
17    // called when client closes connection
18    destroy_AN_local(THIS);
19    if (aisc_main->ploc_st.cnt <= 0) { // last client disconnected
20        names_server_save();
21    }
22    return 0;
23}
24
25int names_init_socket(AN_local *THIS) {
26    aisc_add_destroy_callback((aisc_destroy_callback)names_destroy_locs, (long)THIS);
27    return 0;
28}
29void names_destroy_socket(AN_local *) {
30    aisc_remove_destroy_callback();
31}
Note: See TracBrowser for help on using the repository browser.