4

I have a situation where i need to send commands to a running java application, now i am using tcp/ip socket to send commands to the application using a internet explorer context menu item. But as soon as the application starts virus scanners complain that the application started listening, although i am only listening for local connections. I think this may be confusing to the users. I am looking at others ways of communicating without pissing off av scanners?

akf
39.6k8 gold badges89 silver badges96 bronze badges
asked Sep 13, 2009 at 3:34

3 Answers 3

4

For this, you're best off a file based FIFO queue. Or using Java Native Access/Java Native Interface to write to a NamedPipe or Shared Memory. If you go the JNA/JNI route, you could create a Named Event.

But there's probably no way to do what you want, with any amount of efficiency without going the JNA/JNI route.

answered Sep 13, 2009 at 3:51
Sign up to request clarification or add additional context in comments.

Comments

3

You can use Java Management Extentions (JMX) to expose methods in a running process through a simple web interface.

answered Sep 13, 2009 at 4:36

Comments

1

Sockets are pretty much the traditional way of doing IPC, but if you really want to avoid them, you might be able to come up with a workaround using the local filesystem. You wouldn't want to use standard file reads/writes, since you would most likely want to effectively implement a queue in the filesystem.

If I were going to implement IPC through the filesystem, I'd probably use SQLite (which can be threadsafe when compiled so) and have one table for each listener. I'd probably use a single-column table to insert the message, and the listener would just pull out the row with the lowest rowid, then delete said row.

But my approach is not at all Java-specific, so there might be better ways to do that using Java (such as @darthcoder's response).

answered Sep 13, 2009 at 3:54

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.