
Is there any way to open further communication channels with a subprocess besides what we are given by the subprocess
function?

I believe stdin stdout and stderr would be the only standard channels, what others were you hoping for?

If the subprocess is long lived and opens it’s own sockets for communication, then I guess you could connect to those.

@mark.warren be able to create an extra channel between the process and subprocess.

I was thinking more about named pipes.

Hmmm.. It would depend on what the subprocess supported.

In most languages I’ve used then OS subprocesses are only ever guaranteed to have the 3 standard streams. Maybe an expert knows better.

Oh, just noticed @ryanc implemented unix sockets for racket. that would do.

Ah, sorry, I thought you meant extra streams, not a different form of communication other than streams. My bad.

It seems @notjack also implemented something along the lines of unix sockets in net2
, or at least started… Can’t find docs. @notjack how’s it going?

@pocmatos there’s also zeromq if you need something more than simple streams

thanks, I will take a look.

If you also need to support Win and can’t use unix sockets, of course there’s also the option of a TCP connection. (Needn’t be HTTP.)

Drawback: Even if you listen only for localhost connections, JS in a browser can make local connections, so you want some mitigation of that vuln.

e.g. Supply a random token to the launched process that will accept connections, and require connection attempts to supply that same token.

Idea: “It me. I am the thing that launched you. (And if browser JS can launch local programs, you have bigger problems.)”

@greg thanks, I don’t think I have to support Windows. Most large systems to run my software are running some sort of Linux server edition.

I am trying to pump all the data from a process’ input-port
to (current-output-port)
, is there a library out there to ease this? Or I need to manually create a thread that listens on one port and writes to the other? It’s not that hard but I would prefer to have something like port-pump in out
or something…

@pocmatos copy-port
from racket/port

@ryanc awesome, that’s exactly it. Thanks.

Is it feasibly possible to write a Racket script that can effectively “export DrRacket’s binding arrows” for a file? I’m imagining a file output that basically says <name> used@ <file, line, col> defined@ <file, line, col>
, for each identifier in the file

(this is more detailed information than e.g. ctags
could provide)

@blerner it’s certainly possible, I think you want http://docs.racket-lang.org/drracket-tools/Accessing_Check_Syntax_Programmatically.html

thanks

@samth that got me where I wanted. I’m confused, though — using the sample code for arrows
on that page, and an arbitrary racket file as input, there seem to be a lot of duplicate arrows that show up in the output (as in, identical pairs of from/to source locations). why might that be? I’m guessing it has to do with the nine other parameters that are being ignored in that documentation snippet, but I’m not certain