aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/src/tcp_server.h
blob: 55fb1fa5799eec0e93f168034de5dc008306a04a (plain) (tree)
1
2
3
4
5
6
7






                                                          













                                                                                     
/*
 * Copyright (c) 2022 Egor Tensin <Egor.Tensin@gmail.com>
 * This file is part of the "cimple" project.
 * For details, see https://github.com/egor-tensin/cimple.
 * Distributed under the MIT License.
 */

#ifndef __TCP_SERVER_H__
#define __TCP_SERVER_H__

struct tcp_server {
	int fd;
};

int tcp_server_create(struct tcp_server *, const char *port);
void tcp_server_destroy(const struct tcp_server *);

typedef int (*tcp_server_conn_handler)(int conn_fd, void *arg);
int tcp_server_accept(const struct tcp_server *, tcp_server_conn_handler, void *arg);

#endif