Cross-platform scheduler-context helpers for spawning, yielding, sleeping, IPv4 formatting, and TCP wrapper creation.
spawn (callable out -- context): creates, schedules, and returns one new Context whose declared output schema is selected by out.yield (--): schedules the current context for later resumption and dispatches another ready context before returning.canceled? (-- canceled): reports whether the current context was canceled.sleepFor (duration --): wakes the current context not earlier than duration seconds later.sleepUntil (time --): wakes the current context not earlier than absolute time.getTime (-- time): returns the time elapsed since the sync subsystem was initialized.sleepFor and sleepUntil return immediately when the current context is already canceled.ipv4ToString (address -- addressString): converts one host-order IPv4 address in Nat32 representation to a dotted-decimal String.connectTcp (address port -- connection result): connects to a remote peer and returns one TcpConnection plus a result string.listenTcp (address port -- acceptor result): starts one listening TcpAcceptor and returns the acceptor plus a result string.connectTcp and listenTcp take host-order IPv4 addresses as Nat32 and host-order ports as Nat16.TcpAcceptor.accept returns the remote IPv4 address in the same host-order representation.spawn call returns one Context handle that owns the spawned context state.connectTcp call returns one TcpConnection wrapper that owns one connected stream.listenTcp call returns one TcpAcceptor wrapper that owns one listening socket.connectTcp and listenTcp return the empty string on success and one non-empty result string on failure.TcpConnection or TcpAcceptor is invalid and owns no live operating-system resource."canceled" means cancellation was observed before a successful network result was produced.ipv4ToString returns one new String that owns the formatted bytes."sync/sync" use
"String" use
"control" use
{} Int32 {} [
0xC0A86465n32 ipv4ToString print
LF print
context: [("done" LF) printList] () spawn;
@context.wait
0
] "main" exportFunction
192.168.100.101
done