LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Multiple commandlines accessing same instance of a program (https://www.linuxquestions.org/questions/linux-desktop-74/multiple-commandlines-accessing-same-instance-of-a-program-874476/)

udaraliyanage 04-11-2011 09:02 PM

Multiple commandlines accessing same instance of a program
 
I want to write a program that same instance of it can be accesed by multiple comandlines. What kind of a program it should be and how to write it?

zordrak 04-13-2011 03:37 AM

You have to be more clear.

Any executable binary can be run as many times as you like by as many command line consoles as there are.

udaraliyanage 04-13-2011 04:42 AM

Multiple command line
 
yes , we can write multiple instances of a binary program using multple commandlines.
i want to run same instance of the program using multiple commandlines

bluebox 04-13-2011 11:57 AM

"commandline" usually refers to a shell. And a shell is meant to run programs, not to access running programs. So, when using a shell, you'll have to use some kind of client-server architecture, similar to a ftp client, that accesses a ftp server.

"Sockets" are the basic level of interprocess-communication:
http://www.linuxhowtos.org/C_C++/socket.htm

There are higher levels of message buses, like "dbus".

A very low level of communication would be using the filesystem and file-content. Commands as simple as "echo" and "cat" could be enough to access your program.

A different approach would be to simply let your program open multiple windows/terminals. This depends on your needs.

udaraliyanage 04-13-2011 12:09 PM

Multiple commandline
 
I think I got the right answer. thank you very much @bluebox


All times are GMT -5. The time now is 12:03 PM.