Skip to content

add wsSend to connection#70

Merged
cs01 merged 3 commits intomainfrom
wsconn
Feb 28, 2026
Merged

add wsSend to connection#70
cs01 merged 3 commits intomainfrom
wsconn

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Feb 28, 2026

C bridge (lws-bridge.c/h)

  • Added ws_format_conn_id() helper that formats a uv_tcp_t* pointer as a hex string
  • Expanded evt_mem from 16→24 bytes in all 3 event builders (open, message, close) to fit evt[2] = connId
  • Added lws_bridge_ws_send_to() that parses the hex connId, verifies it's in g_ws_conns, and sends a frame

Codegen

  • http-server.ts: Added declare void @lws_bridge_ws_send_to + generateWsSendToFunction() IR wrapper
  • calls.ts: Added wsSend dispatch after wsBroadcast
  • generator-context.ts: Added generateWsSend to interface + base stub; renamed usesMongoose → usesHttpServer
  • llvm-generator.ts: Renamed field/getter/setter, added generateWsSend() impl, pushed generateWsSendToFunction() when wsHandler is registered

Cleanup

  • Deleted dead mongoose.ts
  • Updated compiler.ts and native-compiler-lib.ts to use usesHttpServer
  • Added connId: string to WsEvent in example and test fixture
  • Updated docs with connId field and wsSend(connId, message) section
  • Removed "mongoose" from network test description

@cs01 cs01 merged commit 808564b into main Feb 28, 2026
12 checks passed
@cs01 cs01 deleted the wsconn branch February 28, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant