fix(zmq): Corrected error bindings.

This commit is contained in:
2026-07-08 14:41:47 -04:00
parent ad43577b44
commit 170182b747
3 changed files with 225 additions and 19 deletions
+28
View File
@@ -0,0 +1,28 @@
package main
import "core:fmt"
import "core:os"
import "zmq"
main :: proc() {
ctx := zmq.ctx_new()
defer zmq.ctx_term(ctx)
rep1, _ := zmq.socket(ctx, .REP)
defer zmq.close(rep1)
zmq.bind(rep1, "tcp://*:5555")
rep2, _ := zmq.socket(ctx, .REP)
defer zmq.close(rep2)
if err := zmq.bind(rep2, "tcp://*:5555"); err != nil {
fmt.eprintfln("bind failed: %s", zmq.strerror(err))
switch e in err {
case zmq.ZMQ_Error:
fmt.eprintfln(" variant: ZMQ_Error, member: %v", e)
case os.Platform_Error:
fmt.eprintfln(" variant: Platform_Error, member: %v", e)
case:
fmt.eprintfln(" variant: nil")
}
}
}