aboutsummaryrefslogtreecommitdiff
path: root/src/socket.h
blob: 289c4f147c1d5fe704e351079983fc1f07fc9cb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef POTD_SOCKET_H
#define POTD_SOCKET_H 1

#include <netdb.h>

#define POTD_BACKLOG 3

typedef struct psocket {
    int fd;
    struct addrinfo addr;
} psocket;


int socket_init_in(psocket *psocket, const char *listen_addr,
                   const char *listen_port, struct addrinfo **results);

int socket_bind_in(psocket *psocket, struct addrinfo *results);

int socket_listen_in(psocket *psocket);

#endif