Page 1 of 1

Pipe "problem"

Posted: Wed Oct 04, 2017 3:35 pm
by Giorgio Garabello
Hi, I've created two basic programs that exchange data over the network.
one sends text strings, the other receives and writes them to the screen

The program that send send is as follows:

10 CLS
20 OPEN # 3, N1_PIPE_TEST
30 REPeat CR_LOOP
40 INPUT "TEXT:"; A $
50 PRINT # 3, A $ & CHR $ (10)
60 END REPeat CR_LOOP

the one who is receiving and printing

100 CLS
110:
120 OPEN_IN # 3, PIPE_TEST
130:
140 REPeat CR_LOOP
150 INPUT # 3, A $
160 PRINT A $
170 END REPeat CR_LOOP

Obviously, the file server was launched on the latter (by saying FSERVE)

It works perfectly well, the only strangeness (and that's why I'm writing to you) is that a "delay" of a string in receiving data.
Let me explain with an example

- I write "HI"
. I receive nothing
- I write "HOW ARE YOU?"
. I receive "HI"
- I write "ALL GOOD?"
. I receive "HOW ARE YOU?"

..and so on..

What I do not understand is whether I'm wrong or it works just like that

Giorgio

Re: Pipe "problem"

Posted: Wed Oct 04, 2017 4:25 pm
by RWAP
I assume you have set NET 1 on the fileserver QL and NET 2 on the sending QL (otherwise they both have the same network address which might cause an issue).

It is also unclear - is PIPE_TEST a named PIPE (which only works under SMSQ/e on the fileserver or if you have installed a named pipe toolkit on the fileserver). If not, then it might be trying to create a file called PIPE_TEST in the default directory on the fileserver, which might cause the delay without a FLUSH command.
In either case, you might need to use FLUSH (or FLUSH_CHANNEL command from the DJ Toolkit ) - http://superbasic-manual.readthedocs.io ... html#flush

If you are writing to a temporary file on the fileserver, then specify the device name in the first program as: 20 OPEN # 3, N1_RAM1_PIPE_TEST (for example)

Re: Pipe "problem"

Posted: Wed Oct 04, 2017 4:39 pm
by Giorgio Garabello
RWAP wrote:I assume you have set NET 1 on the fileserver QL and NET 2 on the sending QL (otherwise they both have the same network address which might cause an issue).
yes. correct.
It is also unclear - is PIPE_TEST a named PIPE (which only works under SMSQ/e on the fileserver or if you have installed a named pipe toolkit on the fileserver).
yes, i'm on qpc2.

If not, then it might be trying to create a file called PIPE_TEST in the default directory on the fileserver, which might cause the delay without a FLUSH command.
In either case, you might need to use FLUSH (or FLUSH_CHANNEL command from the DJ Toolkit ) - http://superbasic-manual.readthedocs.io ... html#flush
Flush!!!!!!!
many thanks!!

Re: Pipe "problem"

Posted: Wed Oct 04, 2017 6:28 pm
by stevepoole
Hi,
Concerning the original posting, I note that after Line 60 there is no CLOSE#.
I have not been able to test your code, but this may be the problem?
Regards,
Steve Poole.

Re: Pipe "problem"

Posted: Wed Oct 04, 2017 8:35 pm
by Giorgio Garabello
stevepoole wrote:Hi,
Concerning the original posting, I note that after Line 60 there is no CLOSE#.
I have not been able to test your code, but this may be the problem?
Regards,
Steve Poole.
is only a test, there's no exit form the loop

Giorgio

Re: Pipe "problem"

Posted: Wed Oct 04, 2017 8:37 pm
by Giorgio Garabello
FLUSH

IT CAN BE DONE!!! :-D

Image