moontalk/server/eventloop-server-experiment/extensions/gforth-0.7.3.4th
2024-02-17 18:26:14 +00:00

27 lines
641 B
Forth

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