view seobeo/tests/seobeo_sigpipe_test.c @ 278:8d560f50ed4c

Improve infinite canvas interactions and browser chrome Render Lucide icons directly with Raylib, add searchable icon browsing, robust text editing, entity lifecycle animations, z-order-safe input, semantic themes, and animated editable browser controls. Document rendering, pinning, context, and component extension for future agents. Co-authored-by: Copilot <[email protected]> Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:16:14 -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;
}