5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2008 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
20 /****h* silcutil/Local Network Stream Interface
24 * Local network stream interface enables two or more processes to communicate
25 * with each other in the local machine using local network start. The
26 * interface provides a form of interprocess communication (IPC) using network
31 #ifndef SILCLOCALNETSTREAM_H
32 #define SILCLOCALNETSTREAM_H
34 /****f* silcutil/silc_local_net_create_listener
38 * SilcNetListener silc_local_net_create_listener(const char *filepath,
39 * SilcSchedule schedule,
40 * SilcNetCallback callback,
45 * Creates a local network stream listener and returns a network server.
46 * The `filepath' is a local filepath that must be used by the clients to
47 * connect to the server.
49 * The `callback' will be called when a client connects to the listener
50 * with the `context'. The returned listener must be closed by calling
51 * silc_local_net_close_listener.
53 * Clients can connect to the listener by calling the
54 * silc_local_net_connect.
56 * Returns NULL on error and set silc_errno. If `schedule' is NULL this
57 * will call silc_schedule_get_global to try to get global scheduler.
60 SilcNetListener silc_local_net_create_listener(const char *filepath,
61 SilcSchedule schedule,
62 SilcNetCallback callback,
65 /****f* silcutil/silc_local_net_close_listener
69 * void silc_local_net_close_listener(SilcNetListener local_listener);
73 * Closes the local network stream listener.
76 void silc_local_net_close_listener(SilcNetListener local_listener);
78 /****f* silcutil/silc_local_net_connect
82 * SilcAsyncOperation silc_local_net_connect(const char *filepath,
83 * SilcSchedule schedule,
84 * SilcNetCallback callback,
89 * Connects to the local network server at the provided `filepath'. If
90 * the `filepath' does not exist or is not valid local network listener
91 * the connection will fail.
93 * The `callback' with `context' will be called once the connection has
96 * If `schedule' is NULL this will call silc_schedule_get_global to try
97 * to get global scheduler.
100 SilcAsyncOperation silc_local_net_connect(const char *filepath,
101 SilcSchedule schedule,
102 SilcNetCallback callback,
105 #endif /* SILCLOCALNETSTREAM_H */