diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2026-10-05 00:35:50 -0500 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2026-10-05 00:35:50 -0500 |
| commit | 080f5773cc21c9ccb465a188e8a2e65db5c587ec (patch) | |
| tree | 3c1709811b39c81d44b2dcd7883bd3c4e3e9112b | |
| parent | 2c11d6b914d5bb71669862757f250eb3b63d26e6 (diff) | |
made more header files
| -rwxr-xr-x | Server.h | 5 | ||||
| -rwxr-xr-x | launch-socket.c | 5 | ||||
| -rwxr-xr-x | launch-socket.h | 17 | ||||
| -rwxr-xr-x | launch-web.c | 2 | ||||
| -rwxr-xr-x | launch-web.h | 15 |
5 files changed, 40 insertions, 4 deletions
@@ -38,6 +38,11 @@ struct Server{ void (*on_disconnect)(struct Server *server, int socketFD); }; +/* + * AF_INET, SOCK_STREAM, 0, INADDR_ANY, port, 10, launch_socket + * or + * AF_INET, SOCK_STREAM, 0, INADDR_ANY, port, 10, launch + */ struct Server server_constructor(int domain, int service, int protocol, u_long interface, int port, int backlog, pthread_t (*launch)(struct Server *server)); #endif /* Server_h */ diff --git a/launch-socket.c b/launch-socket.c index e607f62..0c2881c 100755 --- a/launch-socket.c +++ b/launch-socket.c @@ -1,10 +1,10 @@ +#include <stdlib.h> #include <unistd.h> #include <bits/pthreadtypes.h> #include <pthread.h> #include <netinet/in.h> #include <stdio.h> -#include "Server.c" -#include "Server.h" +#include <Server.h> #include <sys/socket.h> #include <poll.h> #include <stdbool.h> @@ -57,7 +57,6 @@ struct recv_data_arg{ struct AcceptedSocket *curr_socket; }; - void *recv_data(void *threadarg){ struct recv_data_arg *recv_d_arg; recv_d_arg=(struct recv_data_arg *) threadarg; diff --git a/launch-socket.h b/launch-socket.h new file mode 100755 index 0000000..0f87b5d --- /dev/null +++ b/launch-socket.h @@ -0,0 +1,17 @@ +#ifndef launch_socket_h +#define launch_socket_h +#include <unistd.h> +#include <bits/pthreadtypes.h> +#include <pthread.h> +#include <netinet/in.h> +#include <stdio.h> +#include <sys/socket.h> +#include <poll.h> +#include <stdbool.h> +#include <string.h> +#include <Server.h> + +void server_close_socket(struct Server *server); + +pthread_t launch_socket(struct Server *server); +#endif diff --git a/launch-web.c b/launch-web.c index e53eb56..ff2970b 100755 --- a/launch-web.c +++ b/launch-web.c @@ -4,8 +4,8 @@ #include <pthread.h> #include <netinet/in.h> #include <sys/socket.h> -#include <Server.c> #include <iceys-utils.h> +#include <Server.h> void server_close(struct Server *server){ server->running=false; diff --git a/launch-web.h b/launch-web.h new file mode 100755 index 0000000..0a25288 --- /dev/null +++ b/launch-web.h @@ -0,0 +1,15 @@ +#ifndef launch_web_h +#define launch_web_h +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <pthread.h> +#include <netinet/in.h> +#include <sys/socket.h> +#include <Server.h> +#include <iceys-utils.h> + +void server_close(struct Server *server); + +pthread_t launch(struct Server *server); +#endif |
