aboutsummaryrefslogtreecommitdiff
path: root/src/tsocket.h
blob: 5028b040a5ca8750d636b657cb6f5791d41fb8aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <netinet/in.h>

#ifndef __TSOCKET_H
#define __TSOCKET_H

struct tsocket {
    int fd;
    const char *addr;
    int port;
};
typedef struct tsocket tsocket_t;

struct tsocket *tsocket_create();
int tsocket_bind(struct tsocket *sock, const char *addr, int hostport);
int tsocket_listen(struct tsocket *sock);
struct tsocket *tsocket_accept(struct tsocket *sock);
void tsocket_destroy(struct tsocket *sock);

#endif