diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2026-10-13 22:00:39 -0500 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2026-10-13 22:00:39 -0500 |
| commit | fb71cdafab9847a15ac67cd56b13d5ada1d7f20e (patch) | |
| tree | 04aea6db708bca1eccbc1011844d1b8cdb7c6da4 /Server.h | |
| parent | 1410fa9524845c01d79d137cd1c600f274c43d69 (diff) | |
removed Server and merged it into launch_socket
launch_socket is now socket_server
fixed a bit of error handling for acceptIncoming
Diffstat (limited to 'Server.h')
| -rwxr-xr-x | Server.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Server.h b/Server.h deleted file mode 100755 index 241351a..0000000 --- a/Server.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef Server_h -#define Server_h - -#include <sys/socket.h> -#include <netinet/in.h> -#include <stdbool.h> -#include <pthread.h> -#include <stdatomic.h> - -struct AcceptedSocket{ - int socketFD; - struct sockaddr_in address; - int error; - bool succ; - pthread_t thread_id; - atomic_bool shutdown; - - struct AcceptedSocket *next; -}; - -struct Server{ - int domain; - int service; - int protocol; - u_long interface; - int port; - int backlog; - atomic_bool running; - - pthread_t server_thread_id; - pthread_t cleanup_thread_id; - - struct sockaddr_in address; - - int socket; - - pthread_mutex_t list_lock; - struct AcceptedSocket *accepted_socket; - - void (*on_message)(struct Server *server, char message[], ssize_t amountRecv, int socketFD); - void (*on_disconnect)(struct Server *server, int socketFD); -}; - -struct Server server_constructor(int domain, int service, int protocol, u_long interface, int port, int backlog); - -#endif /* Server_h */ |
