summaryrefslogtreecommitdiff
path: root/src/connection.h
blob: c213b3cae8b3c5bacc60b33586fb8c021d3345f9 (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
#ifndef _CONNECTION_H_
#define _CONNECTION_H_

#include <glib.h>

struct cmumble_connection {
	GSocketClient *sock_client;
	GSocketConnection *conn;
	GSocket *sock;

	GPollableInputStream *input;
	GOutputStream *output;

	GSource *source;

	struct {
		GSocket *sock;
		gboolean connected;
		GSource *source;
	} udp;
};

struct cmumble;

int
cmumble_connection_init(struct cmumble *cm,
			const char *host, int port);

int
cmumble_connection_fini(struct cmumble *cm);

void
cmumble_connection_udp_init(struct cmumble *cm);

void
cmumble_connection_send_udp_data(struct cmumble *cm,
				 guint8 *data, gsize len);

#endif /* _CONNECTION_H_ */