Mercurial
view seobeo/tests/seobeo_sigpipe_test.c @ 261:b401627fc49e
Add JRPG mock flows and interactive previews
Add scripted mock SSE commands, custom event forwarding, animated chat turns, full-height message navigation, and a cyberpunk resume dossier.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <mrjunejune@users.noreply.github.com> |
|---|---|
| date | Wed, 05 Aug 2026 20:38:32 -0700 |
| parents | 0e7b9464248d |
| children |
line wrap: on
line source
#include "seobeo/seobeo.h" #include <signal.h> #include <stdlib.h> #include <sys/socket.h> int main(void) { Seobeo_Handle *server = Seobeo_Stream_Handle_Server_Create("127.0.0.1", "0"); if (!server) return 1; raise(SIGPIPE); Seobeo_Handle_Destroy(server); int sockets[2]; if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets) != 0) return 1; Seobeo_Handle handle = {0}; handle.socket = sockets[0]; handle.write_buffer_capacity = 64; handle.write_buffer = malloc(handle.write_buffer_capacity); if (!handle.write_buffer) return 1; close(sockets[1]); if (Seobeo_Handle_Queue(&handle, (const uint8 *)"closed", 6) != 0) return 1; int result = Seobeo_Handle_Flush(&handle); close(sockets[0]); free(handle.write_buffer); return result < 0 ? 0 : 1; }