complete rewrite

This commit is contained in:
Nishi 2026-01-07 04:24:22 +09:00
commit 8a717a2b2e
Signed by: nishi
GPG key ID: 27EF69B208EB9343
41 changed files with 2625 additions and 1255 deletions

18
engine/net/testserver.c Normal file
View file

@ -0,0 +1,18 @@
#include <fishsoup.h>
void on(fishsoup_server_t* server, fishsoup_client_t* client) {
fishsoup_packet_t pkt;
pkt.data = "Hello world!";
pkt.header.length = strlen(pkt.data) + 1;
pkt.header.flag = 0;
pkt.header.type = FISHSOUP_PACKET_USER;
fishsoup_packet_send(client->fd, &pkt);
}
int main() {
fishsoup_server_t* server = fishsoup_server(0);
fishsoup_server_on_client(server, on);
fishsoup_server_loop(server);
}