18 lines
592 B
C
18 lines
592 B
C
#pragma once
|
|
#include <sys/socket.h>
|
|
#include <fcntl.h>
|
|
#include <unistd.h>
|
|
#include <netdb.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <sys/epoll.h>
|
|
|
|
int create_tcp_client(char* host, char* service);
|
|
int create_udp_client(char* host, char* service);
|
|
int create_tcp_server(char* host, char* service);
|
|
int create_udp_server(char* host, char* service);
|
|
int make_socket_non_blocking(int fd);
|
|
void add_fd_to_epoll(int epollfd, int fd, uint32_t flags);
|
|
int read_entity(int fd, void* entity, int size);
|
|
void fill_buffer(size_t* written, char* dest, void *src, size_t n);
|