Pipe "problem"

Anything QL Software or Programming Related.
Post Reply
User avatar
Giorgio Garabello
Gold Card
Posts: 277
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, Italy
Contact:

Pipe "problem"

Post 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


RWAP
RWAP Master
Posts: 2834
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Pipe "problem"

Post 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)


User avatar
Giorgio Garabello
Gold Card
Posts: 277
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, Italy
Contact:

Re: Pipe "problem"

Post 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!!


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: Pipe "problem"

Post 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.


User avatar
Giorgio Garabello
Gold Card
Posts: 277
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, Italy
Contact:

Re: Pipe "problem"

Post 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


User avatar
Giorgio Garabello
Gold Card
Posts: 277
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, Italy
Contact:

Re: Pipe "problem"

Post by Giorgio Garabello »

FLUSH

IT CAN BE DONE!!! :-D

Image


Post Reply