[Top][All Lists]

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

Re: [gforth] socket.fs getting started problem

From: kibler
Subject: Re: [gforth] socket.fs getting started problem
Date: Tue, 17 Apr 2012 14:57:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120329 Icedove/10.0.3

Thanks - removing the ~/.gforth cleared it all up.
Good thing I asked, as would have taken a very long time
to figure out that libraries might be in ~/.gforth.
I did a find on the ~/.gforth dir and saw way too
many libraries, and thus I am wondering how
many of my other tests were messed up by it
being there.

Thanks again!

For others - what I saw in my .gforth dir...

On 04/17/12 14:27, Bernd Paysan wrote:
Am Dienstag, 17. April 2012, 10:25:13 schrieb kibler:
The version of gforth I am using:
  >  gforth

Gforth 0.7.9-20120317, Copyright (C) 1995-2011 Free Software Foundation,

The test code based on repost.fs to just open a socket for reading:

\ test.fs - test to see if can open a socket...
require unix/socket.fs

2000 constant nntp

1024 constant status-buf-len
create status-buf status-buf-len 2 + chars allot

: read-status { sock -- ior }

      sock stdout = if \ for debugging
          0 exit endif
      status-buf status-buf-len sock read-line throw 0= -39 and throw { len }
status-buf c@ [char] 1 [char] 3 1+ within if
          status-buf len type cr
          status-buf len type cr
          -21 \ unsupported operation
      endif ;

: repostx

      s" " 2000 open-socket sock !
This fails to compile, since sock is not defined.

: repost

      parse-name { d: server }
      server nntp open-socket { sock }
      sock read-status throw
\    s" AUTHINFO USER " sock write-file throw user sock write-line throw
      sock read-status throw
\    s" AUTHINFO PASS " sock write-file throw passwd sock write-line throw
      sock read-status throw
\    start-id articles start-articles sock process-articles
\    s" QUIT" sock write-line throw
      sock read-status throw
      sock close-file throw ;

A couple of tests and their results:
Ok, here's my test and my result:

Running "nc -l 2000" on one terminal, and gforth test.fs on another terminal:

repost localhost 123

The numbers here are what I entered (should all start with 1 to 3).

Honestly, I have absolutely no clue at all what fails so horribly on your
system, because unix/socket.fs is something I use daily, and get-info is
certainly required, especially applied to localhost.

There is nothing wrong with your way of using open-socket and friends.

What could be possilbe is that you have an old* in your
~/.gforth/libcc-named/.libs, which is not compatible with the new pthread-
enabled engine.  But then, a proper make install will install you a* for the new engine, and it won't look up ~/.gforth/libcc-
named/.libs.  Just in case, remove ~/.gforth, and try again.

reply via email to

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