Matthew

English is not my language, so I'm a bit confused.

In your first messages, you wrote:

"client (web browser) -> connects to node app, with socket.io -> spawns
child process that runs an application on the host  -> application sends
message back to node app (unix sockets?) -> node app returns message to the
client that spawned the process -> client and application are now sending
and receiving messages to each other.

In this application the "app" could be something as simple as a bash script
that just echoes back whatever messages was sent from the browser as part
of a form input."

Mark Hahn mentioned child_process exec
http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback

I didn't try it. But the limitation is that the stdout is given at the end
of the process (I guess) and you need the output at any new line (maybe),
meanwhile the child process could run for hours. And then send the child
process output (a line?) back to the client that remotely spawned the child
process. Maybe you need
http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
to listen to the output, not at end. (take into account that some programs
don't give the output while running, only at end; I see C programs without
calling flush())

Why now you are using require('net')? Where is the spawned process? Or you
have ONLY one external process to attend all the clients?

Angel "Java" Lopez
@ajlopez



On Wed, Nov 6, 2013 at 5:57 AM, Floby <[email protected]> wrote:

> maybe not *what* you are trying to do, but definitely *how* :)
>
>
> On Monday, 4 November 2013 21:29:37 UTC+1, Matthew Sudol wrote:
>>
>> @Floby - termkit looks cool but that's not really what I'm looking to do.
>>
>> @Mark - thanks for the info, i've got a handle on exec now, all that's
>> left for me to do is figure out a way to 1 - 1 map my client side in the
>> browser to the spawned bash script (which runs until I tell it to stop) -
>> the bash script is going to receive PINGs from the browser and return PONGs
>> - my goal is that each browser that connects to node spawns that bash
>> script in its own process and then they start talking to each other.  I
>> think I've got a good handle on it now.
>>
>  --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to