Can Java work as a name server?

I know that Java can act as a client for reading / writing named pipes, but I need another program that acts like a server.

In this case, the program with which I communicate should act as a client, not a server. Is it possible for Java to act in server mode for named pipes?

EDIT: There are client and server modes in named pipes (Windows). First, the server must be installed before the client can connect to it. I have an outdated application that acts like a "client", which means that it connects to what it assumes, it is an already named pipe. I have a new Java application that I would like to associate with this deprecated application using named pipes. I just found examples of how to use Java named pipes in connection with previously installed named pipes.

+6
source share
1 answer

Well, on linux and mac, you can always release java to the console one line at a time. Example:

In one terminal window:

mkfifo myPipe java -jar mydataserver.jar > mkfifo 

In the second terminal window, do the following:

  while read line; do echo "What has been passed through the pipe is \ ${line}"; done<myPipe 
+1
source

Source: https://habr.com/ru/post/951349/


All Articles