gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issues with socket.fs on OpenBSD


From: nature
Subject: Issues with socket.fs on OpenBSD
Date: Sat, 03 Sep 2022 10:23:24 +0200
User-agent: mu4e 1.8.9; emacs 28.1

Hi,

First of all, thanks a lot for this wonderful project that is Gforth!

Lately I've been playing around with it on OpenBSD and because the
latest version in the ports is 0.7.3, I took on myself to build
0.7.9_20220728 and after quite a lot of trial and error, I succeded, I
hope this paved the way for the maintainer of the ports once 1.0 comes out.

Now, trying to make a small web server (I tried inetd with httpd and
this works perfectly, but I want to use sockets from within forth) I
realized that there is an issue when using unix/socket.fs.

I first tried some simple http server available on github like
https://github.com/Payphone/F-HTTP/blob/master/http.fs or
https://github.com/cthulhuology/http.fs/blob/master/http.fs but they
didn't work.  Then I tried something simpler like the echo server wrom
rosettacode: https://rosettacode.org/wiki/Echo_server#Forth and this
didn't work as well.

I then tried to insert some ." at different places and I realized that
create-server and accept-socket works, it's read-socket that
fails/blocks indefinitely.  When going deeper and trying to figure out
where exactly in read-socket things were blocking, I found that it's the
recv call that blocks/fails.  I wasn't able to figure out more than
that...

One last thing, but I am not sure if it is relevant, when using the
first http server, it can listen and accept connection, but when I query
with curl, I see that the GET headers are sent but then it waits
indefinitely for the reply (which will never come because recv blocks).
But when I cancel the curl process wich ctrl-c, the return value of recv
was 78 (ENOSYS "Function not implemented" according to sys/errno.h on my
system).

Let me know I can provide more things to help troubleshoot this.

Cheers,
-- 
nature



reply via email to

[Prev in Thread] Current Thread [Next in Thread]