SocketResultDecoder¶
Decodes the U8 returned by the five pony_os_* socket runtime functions
(pony_os_writev, pony_os_send, pony_os_recv, pony_os_sendto,
pony_os_recvfrom) into a SocketResult union.
This is the Pony-side dual of pony_socket_result_t defined in
src/libponyrt/lang/socket.h of ponyc. The integer values produced by
the SocketResultOk/SocketResultRetry/SocketResultError primitives'
apply() methods must match the C-side PONY_SOCKET_OK/
PONY_SOCKET_RETRY/PONY_SOCKET_ERROR constants, which are part of the
FFI ABI. Keep both files in sync.
Any out-of-range U8 is collapsed to SocketResultError so unknown
C-side values fail closed. Adding a new wire value on the C side
requires updating both the SocketResult union and this decoder.
Constructors¶
create¶
Returns¶
- SocketResultDecoder val^
Public Functions¶
apply¶
Parameters¶
- v: U8 val
Returns¶
eq¶
Parameters¶
- that: SocketResultDecoder val
Returns¶
- Bool val
ne¶
Parameters¶
- that: SocketResultDecoder val
Returns¶
- Bool val