moontalk/server/eventloop-server-experiment/extensions/gforth-0.7.3.4th

27 lines
641 B
Plaintext
Raw Normal View History

2024-02-17 13:26:14 -05:00
CONFIG_C_FFI invert [IF]
cr
." To run this program on Gforth 0.7.3 we need the C FFI, as setsockopt" cr
." is not available in 0.7.3." cr
abort
[THEN]
\ Gforth 0.7.3 doesn't seem to have these defined.
2 Constant AF_INET
$40 Constant MSG_DONTWAIT
$4000 constant MSG_NOSIGNAL
2048 constant SOCK_NONBLOCK
1 constant SOL_SOCKET
2 Constant SO_REUSEADDR
11 constant EAGAIN
sockaddr_in nip constant /sockaddr_in
4 constant /option_value
' closesocket alias close
c-library socketextlib
c-function setsockopt setsockopt n n n a n -- n ( sockfd level optname optval optlen -- r )
end-c-library