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

#ifndef __TSOCKET_H
#define __TSOCKET_H

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

struct tsocket *tsocketNew();
int tsocketBind(struct tsocket *sock, const char *addr, int hostport);
int tsocketListen(struct tsocket *sock);
struct tsocket *tsocketAccept(struct tsocket *sock);
void tsocketDelete(struct tsocket *sock);

#endif