aboutsummaryrefslogtreecommitdiff
path: root/include/slweb/server.h
blob: fa7db014b229cfaba8ec0af7cb8056aa61b35afd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef SERVER_H
#define SERVER_H

#include <stdbool.h>
#include <stddef.h>

struct server *server_init(unsigned short port);
struct server_client *server_poll(struct server *s, bool *io, bool *exit);
int server_read(void *buf, size_t n, struct server_client *c);
int server_write(const void *buf, size_t n, struct server_client *c);
int server_close(struct server *s);
int server_client_close(struct server *s, struct server_client *c);
void server_client_write_pending(struct server_client *c, bool write);
int server_async(struct server *s, int (*f)(void *), void *user);

#endif /* SERVER_H */