aboutsummaryrefslogtreecommitdiff
path: root/client/libacron/private/connection.h
blob: a76fada4b680cdc7d4e3defd4486f8119d9eb133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Created by yuuta on 7/19/22.
 */

#ifndef LIBAC_CONNECTION_H
#define LIBAC_CONNECTION_H

#include "win32.h"
#include "wic.h"
#include "libac.h"
#include <stdbool.h>

#ifdef WIN32
#include <winsock2.h>
#endif

/**
 * Used to transfer deserialization result from receive handler to ac_receive().
 */
struct ac_result {
    bool has_result;
    int res;
    ac_obj_t *obj;
};

/**
 * Internal representation of void *connection.
 */
struct ac_connection {
    ac_connection_parameters_t parameters;
    struct wic_inst inst;
    char *url;
    SOCKET fd;
    bool established;
    /* Result from message handler.
     * Message handling will happen at the same thread as ac_receive (lib wic). */
    struct ac_result result;
};

#endif /* LIBAC_CONNECTION_H */