KroysNetApi
Loopback TCP for tools that talk to other programs on this machine (permission network.loopback). Editor target only.
Declaration
Declared in kroys/kroys_plugin.h.
kroys_plugin.h
typedef struct KroysNetApi { ... } KroysNetApi;
Members
#uint32_t structSize;Size of this struct as the writer compiled it (sizeof); the reader uses it to detect members appended by later minor versions.
#uint32_t reserved;Padding reserved for later use; leave it 0.
#KroysResult (KROYS_CALL* OpenListener)(KroysContext context, uint16_t port, KroysHandle* outListener);TCP listener on KROYS_NET_BIND when it is a 127.x address, else 127.0.0.1 (never another interface). Port 0: any free port.
#uint16_t (KROYS_CALL* ListenerPort)(KroysContext context, KroysHandle listener);The port a listener is bound to.
#const char* (KROYS_CALL* ListenerAddress)(KroysContext context, KroysHandle listener);The address a listener is bound to ("127.0.0.1"; host string).
#KroysResult (KROYS_CALL* Accept)(KroysContext context, KroysHandle listener, KroysHandle* outConnection);Non-blocking; *outConnection = 0 when nothing is pending.
#int64_t (KROYS_CALL* Receive)(KroysContext context, KroysHandle connection, void* buffer, size_t capacity);Bytes read (> 0), 0 when nothing is pending, -1 once closed or on an error.
#int64_t (KROYS_CALL* Send)(KroysContext context, KroysHandle connection, const void* data, size_t size);Bytes queued (may be fewer), -1 on an error.
#KroysResult (KROYS_CALL* Close)(KroysContext context, KroysHandle handle);Closes a listener or connection; the handle becomes invalid.
Members
uint32_t structSize; uint32_t reserved; KroysResult (KROYS_CALL* OpenListener)(KroysContext context, uint16_t port, KroysHandle* outListener); uint16_t (KROYS_CALL* ListenerPort)(KroysContext context, KroysHandle listener); const char* (KROYS_CALL* ListenerAddress)(KroysContext context, KroysHandle listener); KroysResult (KROYS_CALL* Accept)(KroysContext context, KroysHandle listener, KroysHandle* outConnection); int64_t (KROYS_CALL* Receive)(KroysContext context, KroysHandle connection, void* buffer, size_t capacity); int64_t (KROYS_CALL* Send)(KroysContext context, KroysHandle connection, const void* data, size_t size); KroysResult (KROYS_CALL* Close)(KroysContext context, KroysHandle handle);
KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.