Conversation
Please and thank you
It overcomplicates app initialization, leads to confusing runtime errors, and prevents multiple models from being open at the same time
Also fixes a bug where Cmd+Q bypassed NetLogo's quit method
The idea is that this will be used by an editor plugin so that you can do things like running |
7183f0d to
3b3d22f
Compare
|
@kgmt0 Unfortunately, this new library is even worse on Windows than the last one. I don't get any exception dialogs when toggling the preference or starting up NetLogo, but I am no longer able to connect to the pipe. If I use your solution as is, it says it can't access the file, presumably because pipes are supposed to be created at |
Yes, it turns out Windows supports Unix sockets now, so I just used Unix sockets on all OSes. But since there's no longer any need for platform-specific code, I'm thinking I might as well just use the Java standard library and create the socket myself. I'll update the PR if that goes well. |
|
Ah ok, fantastic! Thanks for the clarification. |
|
It looks like switching to just using the Java standard library would be more work than I thought. For some reason, Unix sockets only work with |
3b3d22f to
3cc143a
Compare
3cc143a to
d4a9f06
Compare
This creates a Unix socket (or a named pipe on Windows) that listens to commands. An external editor can use this socket to send commands for NetLogo to run.
d4a9f06 to
8df2159
Compare
30fc104 to
ac39ffb
Compare
bfd5da7 to
4087ac8
Compare
When enabled, this creates a Unix socket (or a named pipe on Windows) that listens to commands. An external editor can use this socket to send commands for NetLogo to run in the form of JSON objects that look like this:
{"type": "nl-run-code", "code": "show 123"}.This still needs to be tested on Windows and OSX. I've only tested it on Linux. On Linux (and probably OSX too), an easy way to test this is to use OpenBSD Netcat (GNU Netcat doesn't support Unix sockets). You can open a connection like this
nc -U /path/to/socket/netlogo-1234and enter the JSON Object you wan to send. On Linux and OSX, the socket will be put inXDG_RUNTIME_DIRif it is set, otherwise it will be put in~/.netlogo/7.0. You can also see the exact path in the console output.