Um servidor back-end personalizado, escrito inteiramente em C, projetado para rodar um aplicativo simples de chat usando o endereço IPv4 e as portas definidas no arquivo .config
.
O servidor utiliza a função fork()
para lidar com múltiplos clientes em paralelo, permitindo enviar e receber requisições HTTP de forma independente.
O front-end em HTML é uma interface mínima gerada por IA, destinada apenas a fornecer comunicação básica com o servidor. Como o foco principal deste projeto foi a implementação do back-end, não investi tempo em criar um front-end customizado completo.
Do ponto de vista de aprendizado e funcionalidade, considero este projeto um sucesso pelos seguintes motivos:
-
Consegui um entendimento sólido do protocolo HTTP.
-
Finalmente entendi como os sockets funcionam — algo que foi um desafio para mim por muito tempo.
-
Fiz um esforço consciente para minimizar ajuda externa (IA, Stack Overflow, etc.). Na maior parte do tempo, consegui, exceto em casos específicos, como aprender sobre a função
flock()
(que eu não sabia que existia) e corrigir pequenos bugs, geralmente apenas erros de digitação. (Além do frontend) -
O servidor funciona melhor do que eu esperava, lidando com requisições e fechando conexões de forma confiável.
A customized back-end server written entirely in C, designed to run a simple chat application using the IPv4 address and ports defined in the .config
file.
The server uses the fork()
function to handle multiple clients in parallel, allowing it to send and receive HTTP requests independently.
The HTML frontend is a minimal interface generated by AI, intended only to provide basic communication with the server. Since the main focus of this project was back-end implementation, I didn’t invest time in creating a full-fledged custom frontend.
From both a learning and functionality perspective, I consider this project a success for the following reasons:
-
I gained a solid understanding of the HTTP protocol.
-
I finally understood how sockets work—something that had been a challenge for me for a long time.
-
I made a conscious effort to minimize outside help (AI, Stack Overflow, etc.). For the most part, I succeeded, except for specific cases like learning about the
flock()
function (which I didn’t know existed) and fixing minor bugs, often just typos. (Aside from the frontend) -
The server works better than I expected, handling requests and closing connections reliably.