diff options
Diffstat (limited to 'tsocket.h')
-rw-r--r-- | tsocket.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tsocket.h b/tsocket.h new file mode 100644 index 0000000..5a8826c --- /dev/null +++ b/tsocket.h @@ -0,0 +1,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 |