2026-05-25 17:25:50 -07:00
|
|
|
#ifndef INCLUDED_SERVER_H
|
|
|
|
|
#define INCLUDED_SERVER_H
|
|
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
2026-05-25 23:13:27 -07:00
|
|
|
#define SERVER_BACKLOG 32
|
2026-05-25 17:25:50 -07:00
|
|
|
|
|
|
|
|
typedef struct _Server Server;
|
|
|
|
|
|
|
|
|
|
Server *make_server(const char *text_addr, uint32_t port);
|
|
|
|
|
|
|
|
|
|
void destroy_server(Server *server);
|
|
|
|
|
|
|
|
|
|
// same return value as accept(2)
|
|
|
|
|
int server_accept(Server *server);
|
|
|
|
|
|
|
|
|
|
#endif
|