LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-12-2005, 02:19 PM   #1
Z505
LQ Newbie
 
Registered: Mar 2005
Distribution: Custom Debian and Slack
Posts: 16

Rep: Reputation: 0
Messaging system for integrating apps


Is there a messaging system that is recommended, when integrating two applications together? Or when integrating a library (SO) with an executable (ELF)?

With windows, you have the sendmessage() and postmessage() convenience.. but it's not secure and it's not exactly internet ready by itself.

I was thinking of just using TCP to send messages to apps (each app acts as it's own standalone client/server).

But TCP is a fairly low level by itself. By that, I mean you send strings, and you have to parse the strings on one end (sigh). Are there any TCP wrappers built thich intend to create a common messaging system for applications?

Or, is there a common messaging system used by linux programmers?

Doesn't have to be TCP, I just want to get my feet wet with what messaging systems are used out there.

I like the idea of designing a messaging system in TCP sockets, so that in the future, the application is internet ready. But I don't like everyone re-inventing a new messaging scheme each time (rather some common wrappers should be written?).

If you think TCP is a bad idea, let me know.. are there other solutions? would they be network ready?

I've read briefly about POSIX messaging ques (only newer kernels have this working?), domain sockets, and shared memory.

I have used piping before, but that's easier if you are just piping text from one app to another.. not the easiest messaging system.

Last edited by Z505; 07-12-2005 at 02:23 PM.
 
Old 07-12-2005, 05:16 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Re: Messaging system for integrating apps

Quote:
Originally posted by Z505
I was thinking of just using TCP to send messages to apps (each app acts as it's own standalone client/server).

But TCP is a fairly low level by itself. By that, I mean you send strings, and you have to parse the strings on one end (sigh). Are there any TCP wrappers built thich intend to create a common messaging system for applications?
Socket is a good option. There are no well-known messaging system, because every app has it's own format. You need to have some kind of a parser. It can be something based on flex/bison (you can use standard file tools, because socket is seen as yet another file). If like XML, you can use your favourite XML paser (it's an overkill for most apps).

Quote:
Or, is there a common messaging system used by linux programmers?
No such thing exists IMO. There are too many possibilities, requirements for different apps. If you can write more about yours, there may be something already done that you can use.

Quote:
I like the idea of designing a messaging system in TCP sockets, so that in the future, the application is internet ready. But I don't like everyone re-inventing a new messaging scheme each time (rather some common wrappers should be written?).
As I wrote above: if you can fit with your scheme in existing implementations, that's great. Most don't.

Quote:
I've read briefly about POSIX messaging ques (only newer kernels have this working?), domain sockets, and shared memory.
Messaging queues are nice, but only work locally on one machine. Still, you usually need to parse the messages, because you get plain data. I wouldn't say it works only on newer kernels. Works nicely with 2.4 and 2.6.

Unix domain sockets are the same as sockets using TCP from programmer's point of view. The difference is in socket type you pass to the functions when initializing. Usage is exactly the same.

Shared memory works also only locally. rather harder to use than messaging queues if you want to send messages. If you prefer large areas of shared data - it's nearly perfect.
 
Old 07-12-2005, 08:42 PM   #3
Z505
LQ Newbie
 
Registered: Mar 2005
Distribution: Custom Debian and Slack
Posts: 16

Original Poster
Rep: Reputation: 0
The domain sockets I have come across before, and I noticed the programming behind them looked exactly similar to TCP. Thanks for clearing that up.
<p>
I guess some common things I am looking to send across in GUI apps are things like changing the sizes of windows, hiding controls, automating menu commands. Then if I wanted to do something more complex, such as control a custom text editor component, I'd roll my own functions for that.
<p>
For console apps it's a bit more custom. But with a GUI there are common things that programmers could be able do.. (moving, sizing, enabling, disabling controls etc.).
<p>
You think there are some wrappers out there for messaging GTK controls and QT controls? I'd hate to go and write a messaging system which sends text to an edit box for example, if there is some stuff out there already. Or GTK buttons, widgets, QT buttons, QT widgets.
 
Old 07-13-2005, 04:45 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
Originally posted by Z505
I guess some common things I am looking to send across in GUI apps are things like changing the sizes of windows, hiding controls, automating menu commands. Then if I wanted to do something more complex, such as control a custom text editor component, I'd roll my own functions for that.

For console apps it's a bit more custom. But with a GUI there are common things that programmers could be able do.. (moving, sizing, enabling, disabling controls etc.).

You think there are some wrappers out there for messaging GTK controls and QT controls? I'd hate to go and write a messaging system which sends text to an edit box for example, if there is some stuff out there already. Or GTK buttons, widgets, QT buttons, QT widgets.
Well..look into Qt docs. There are signals and slots available. The idea is simple. Imagine two buttons. You want them both to be pressed and released. It means, if they are in "released" state and one is pressed, both should be pressed. With Qt it's easy. Buttons have pressed signal, you connect signal from one with slot of button 2 which actually presses it (chages state). The same with signal from button 1 and sllot of button 2. You can write both custom signals and slots. The widgets have sets of them by default. That's probably exactly what you want.

GTK has similar functions.

Edit: The Qt and GTK stuff works in one app (may be multithreaded). Not quite sure what you exactly need

Last edited by Mara; 07-13-2005 at 04:47 PM.
 
Old 07-13-2005, 06:35 PM   #5
Z505
LQ Newbie
 
Registered: Mar 2005
Distribution: Custom Debian and Slack
Posts: 16

Original Poster
Rep: Reputation: 0
So you're saying it works fine within one application. But if I was creating a MyProgram.Elf and I wanted to connect to HerProgram.Elf I couldn't easily do it without him rolling his own embedded server in HisProgram.elf? (and of course, me needing to write the client, in MyProgram.Elf) ;-)

More specifically, it would be nice in the Gnu Linux operating system, if the owner, John Doe could link to a "message sharing" library when he compiles HisProgram.elf. This message sharing library would allow Mary Doe's application, HerProgram.Elf to talk to the GUI widgets in HisProgram.Elf and not just GUI widgets, other important things like sending data.

This above, is essentially what th windows API does.. but not securely. I hope someone from Linux has a solution that is secure... if not, I'm sure this is one of the reasons windows is so successful on the desktop market.

This is where I think the windows API is what makes windows so successful in the desktop market. I am still hoping though, that you can, or that someone has written a way to send messages between two applications' widgets

Also, I came across this link below.. but not really sure if it helps with widgets.. maybe it just makes sending the actual message easier.

MsgConnect System

Even if msgconnect makes sending messages easier, I'm still wondering whether maybe the actual Kernel or part of Linux should have something built in.

Also, if something isn't written for Linux that does this, I'd definitely start a project that hopefully accomplishes this goal.

I appreciate the help and discussion so far.
 
Old 07-14-2005, 05:13 PM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I don't think that the system in Linux environment could be more useful for programmer than message queues for example, are. The thing is that there are many toolkits for writing GUI apps. They use different methods of communication. The IPC system should handle them all. Using message queues or sockets you can pass everything. You just need to parse what you get. But that's what you always need to do.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
To send apps to system tray aristarchus Debian 3 10-20-2005 01:12 PM
DT messaging system errors hopbalt Solaris / OpenSolaris 10 08-18-2004 03:13 AM
Instant messaging apps for KDE RedHat123 Linux - Software 5 01-02-2004 05:37 AM
system apps Nechos Linux - Newbie 2 09-27-2003 05:30 AM
Apps to monitor system temp? AMDPwred Linux - Software 5 06-11-2003 10:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration