Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Dear Monks,

I want to write two scripts, call them the server and the client, however, since it's intended to run on standalone as well as networked computers, I don't want to communicate over TCP/IP or any other networking protocol for that matter. Another thing involved here is that the primary target Operating System is Windows.
The server is supposed to watch the parallel port (using much of the code of Adremo electrical wheelchair testutility) and whenever it detects a change in the values it reads it should set a flag and allow a client program to see that, and get the value the server just read. The problem is certainly not how to read these values, or how to write a deamon/system tray script. I know how to do this, so please read on.

update: From discussion on the CB it is clear that this posting is a bit too vague. Let me explain a bit better: Currently all scripts I wrote that can be controlled from the mentioned wheelchair all have the same code that checks the parallel port for changes. I want to pull that part of the code out of those scripts and have a server/deamon running that takes care of communicating with the wheelchair. Then (possibly) multiple clients (pVoice, pStory, pShell etcetera) can run and connect to that server and don't have to worry about communicating with the parallel port themselves anymore. However, the values the server reads change very quickly (it may have a certain value for only 1 or 2 cycles (a cycle is about 10ms), that's why I presumed that writing the information to a file wouldn't be fast enough.

The client is a totally seperate script that can be fired up whenever the enduser likes. This script should be able to 'connect' in a certain way to the server and watch the flags the server sets or clears.
I know about signals, pipes and stuff, but I wonder what would be the best way to let those scripts communicate with each other. Writing stuff to a file isn't really an option since that's too slow; the value read from the parallel port may have changed already before the client detects the change.

Does anyone have any experience in writing something like this, without using networking?

Thanks,


Jouke Visser, Perl 'Adept'
Using Perl to help the disabled: pVoice and pStory

In reply to Communication between seperate scripts by Jouke

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-23 17:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found