18 lines
344 B
C
18 lines
344 B
C
#ifndef SOCKET_SERVER
|
|
#define SOCKET_SERVER
|
|
|
|
#include "../common/socket_helper.h"
|
|
|
|
#define BACKLOG_SIZE 8;
|
|
|
|
enum server_status {STATUS_LISTENING, STATUS_CLOSED, STATUS_ERROR};
|
|
struct server_info {
|
|
int sock_fd;
|
|
enum server_status status;
|
|
};
|
|
|
|
struct server_info setup(int port);
|
|
enum socket_result serve_one_request(int sock_fd);
|
|
|
|
#endif
|