pocmatos
2018-10-11 12:15:32

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


mark.warren
2018-10-11 12:18:10

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


mark.warren
2018-10-11 12:21:45

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


pocmatos
2018-10-11 12:21:47

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


pocmatos
2018-10-11 12:22:43

I was thinking more about named pipes.


mark.warren
2018-10-11 12:23:40

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


mark.warren
2018-10-11 12:24:50

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


pocmatos
2018-10-11 12:24:55

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


mark.warren
2018-10-11 12:26:16

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


pocmatos
2018-10-11 12:32:29

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?


ryanc
2018-10-11 12:42:06

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


pocmatos
2018-10-11 12:50:12

thanks, I will take a look.


greg
2018-10-11 14:21:40

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


greg
2018-10-11 14:21:53

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.


greg
2018-10-11 14:22:20

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


greg
2018-10-11 14:22:55

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


pocmatos
2018-10-11 14:56:08

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


pocmatos
2018-10-11 14:59:07

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…


ryanc
2018-10-11 15:03:42

@pocmatos copy-port from racket/port


pocmatos
2018-10-11 15:04:52

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


blerner
2018-10-11 23:20:34

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


blerner
2018-10-11 23:20:46

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


samth
2018-10-12 00:41:19

blerner
2018-10-12 00:42:49

thanks


blerner
2018-10-12 02:05:28

@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