LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 05-14-2009, 12:59 PM   #1
mrtedweb
LQ Newbie
 
Registered: May 2009
Posts: 11

Rep: Reputation: 0
Linux equivalent of COM?


Hello everyone,

I'm new to Linux and wonder if there's an equivalent to Windows COM? I have two applications that need to talk to each other across a network. I have no idea where to begin and really hope somebody can answer my question.

Thanks!
 
Old 05-14-2009, 01:57 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by mrtedweb View Post
Hello everyone,

I'm new to Linux and wonder if there's an equivalent to Windows COM? I have two applications that need to talk to each other across a network. I have no idea where to begin and really hope somebody can answer my question.

Thanks!
You need to learn (about) socket programming. Really just a few lines in, for example, Perl (like 10 or so lines for client/server).

Will be more in "C".

Roughly, very similar to files when sockets are created/connected to.
 
Old 05-14-2009, 03:38 PM   #3
hitchhik
LQ Newbie
 
Registered: May 2009
Posts: 3

Rep: Reputation: 0
Nework programming library in C++

Quote:
Originally Posted by mrtedweb View Post
Hello everyone,

I'm new to Linux and wonder if there's an equivalent to Windows COM? I have two applications that need to talk to each other across a network. I have no idea where to begin and really hope somebody can answer my question.

Thanks!
It might not be a COM equivalent, but you can look into the wvstreams library at http://alumnit.ca/wiki/?WvStream if you want to do some C++ development and don't want to rewrite everything from scratch.

...hh
 
Old 05-14-2009, 11:26 PM   #4
DCOH
Member
 
Registered: Oct 2006
Location: Ohio
Distribution: Fedora 13/14/15KDE/PclinuxOS
Posts: 95

Rep: Reputation: 16
The com ports in linux start with ttyS0 and go on from there the next one would be ttyS1.
 
Old 05-15-2009, 09:14 AM   #5
hitchhik
LQ Newbie
 
Registered: May 2009
Posts: 3

Rep: Reputation: 0
Cool

Quote:
Originally Posted by DCOH View Post
The com ports in linux start with ttyS0 and go on from there the next one would be ttyS1.


Just in case this wasn't a joke - I do believe the original poster referred to the MS Component Object Model (COM). http://www.microsoft.com/com/default.mspx
 
Old 05-15-2009, 10:30 AM   #6
mrtedweb
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks to everyone for your help!

I finally realized I need socket programming (thanks to Sergei Steshenko). My client is looking for a magic bullet that will reduce their current costs as well as help with maintenance issues. Obviously my first thought was Linux (I'm starting with Ubuntu). I'm needing a little push to get me started as the current application was built with Visual Basic (ugh).

Last edited by mrtedweb; 05-15-2009 at 10:41 AM.
 
Old 05-15-2009, 11:39 AM   #7
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,214

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
netcat is good for quick-and-dirty data transfer within a network.

man netcat
__________________

i am confused by how com plays into this. microsoft command object modules are atiquated self-contained dos executables replaced by windows pe (portable executable) *.exe's.

linux uses elf (executable and linking format).

__________________

oh wait you are talking about com port (usually refered to as a serial port) ?

Quote:
The serial ports are named ttyS0, ttyS1, etc. (and usually correspond respectively to COM1, COM2, etc. in DOS/Windows). The /dev directory has a special file for each port. Type "ls /dev/ttyS*" to see them. Just because there may be (for example) a ttyS3 file, doesn't necessarily mean that there exists a physical serial port there.
i presumed you meant you are connecting via an ethernet network.
__________________

this is also duplicated in the newbies forum...

__________________

what does the program do ?

can you explain what you are trying to accomplish ? i assume there are a few ways to impliment it in linux... i have no idea of what 'windows com' you speak of and i have no idea of what it actually does ?

Last edited by schneidz; 05-15-2009 at 11:44 AM.
 
Old 05-15-2009, 11:45 AM   #8
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by mrtedweb View Post
Thanks to everyone for your help!

I finally realized I need socket programming (thanks to Sergei Steshenko). My client is looking for a magic bullet that will reduce their current costs as well as help with maintenance issues. Obviously my first thought was Linux (I'm starting with Ubuntu). I'm needing a little push to get me started as the current application was built with Visual Basic (ugh).
I can find a sockets tutorial in Perl - aren't you tempted to have something up and running after writing like ~20 lines of code altogether ?

...

Anyway, I think you may also need to learn what 'fork' and 'socketpair' are, and maybe also what 'exec' is.

Last edited by Sergei Steshenko; 05-15-2009 at 11:48 AM.
 
Old 05-15-2009, 01:00 PM   #9
rriggs
Member
 
Registered: Mar 2009
Location: Colorado, US
Distribution: Fedora 13, Fedora 14, RHEL6 Beta
Posts: 46

Rep: Reputation: 17
I assume you mean DCOM (Distributed COM) and not COM. Linux does not have a DCOM equivalent that is part of the base OS. That's because DCOM is OS-specific and in the Linux/Unix world, interoperability is king. There are numerous options, depending on the language you wish to use and the complexity of the network communications. You can use things as complicated as SOAP or CORBA for this, to message queues (http://fedoraproject.org/wiki/Featur...Infrastructure), to xmlrpc, all the way down to netcat, rsh or direct socket connections.

You haven't told us what language you may be using. That will determine what options you have. Not every technology has a decent language binding.

If you are doing professional work, consider using a technology that provides for a little more resiliency such as message queues. This can allow you to focus on the high-level stuff rather than getting bogged down in low-level socket stuff.
 
Old 05-15-2009, 01:01 PM   #10
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,214

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by Sergei Steshenko View Post
...

Anyway, I think you may also need to learn what 'fork' and 'socketpair' are, and maybe also what 'exec' is.
i remember in 'operating system design' class that the windows equivelent of fork() then exec() -- (or i always cheated and used system()) is NTCreateProcess(...).

do they now wrap it in something called com ?
 
Old 05-15-2009, 01:09 PM   #11
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by schneidz View Post
i remember in 'operating system design' class that the windows equivelent of fork() then exec() -- (or i always cheated and used system()) is NTCreateProcess(...).

do they now wrap it in something called com ?
No, AFAIK they (UNIXes) do not wrap it in something called 'com'.

I also very much prefer 'system', especially in Perl, but if one really wants IPC (i.e. processes talk to each other) then fork (with its file handles duplication) and exec are the way to go.

OTOH, if one just wants to start another process an wait for its completion, then 'system' is apparently the simplest way to do it.

...

Anyway, if you use sockets, since one can use explicit port number, the processes can talk to each other not being forked in father -> child manner.
 
Old 05-15-2009, 01:12 PM   #12
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,214

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by Sergei Steshenko View Post
No, AFAIK they (UNIXes) do not wrap it in something called 'com'.
i was asking if NTCreateProcess() is now defunct in favor of something like com() ?

i still dont know what com is ? (a few post above i mistook it for dos executables or serial port).

Last edited by schneidz; 05-17-2009 at 03:30 PM.
 
Old 05-15-2009, 01:21 PM   #13
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by schneidz View Post
Quote:
Originally Posted by Sergei Steshenko View Post
No, AFAIK they (UNIXes) do not wrap it in something called 'com'.
i was asking if NTCreatProcess() is now defunct in favor of something like com() ?

i still dont know what com is ? (a few post above i mistook it for dos executables and serial port).
I can't answer your question - I only recently started porting my stuff to Windows, and I'm doing it in cross-platform manner, so I'm not enough familiar with NT stuff.

...

COM, AFAIK, is Common Object Model.

Last edited by Sergei Steshenko; 05-15-2009 at 01:23 PM.
 
Old 05-15-2009, 08:51 PM   #14
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 241Reputation: 241Reputation: 241
Quote:
Originally Posted by mrtedweb View Post
Thanks to everyone for your help!

I finally realized I need socket programming (thanks to Sergei Steshenko). My client is looking for a magic bullet that will reduce their current costs as well as help with maintenance issues. Obviously my first thought was Linux (I'm starting with Ubuntu). I'm needing a little push to get me started as the current application was built with Visual Basic (ugh).
you can also look at Python's socket programming.
 
Old 05-18-2009, 11:14 AM   #15
mrtedweb
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Until now, I have only programmed in Windows (with the exception of web development). I have always used Microsoft's Component Object Model to have separate applications communicate with eachother (DLL Hell). Linux is a whole new world to me and I'm obviously at the "bewilderment" stage. Thanks to everyone for their response to this thread. It has amazed and encouraged me.

I'm designing a basic client/server POS application. Several terminals will need to access the server simultaneously across a local network. I thought about using Windows COM, but I'm unsure of how to implement that across a network. I toyed with the idea of using SOAP, but my experience with SOAP required a web server. Not neccessary/desirable since it will be on a local network and we're trying to simplify things. It appears that sockets are the best way to go and Linux could possibly provide for a simple yet stable environment. Am I being naive to think that?

My biggest question now is which flavor of Linux to use. I imagine the only way to answer this question is by experimenting. Are there any problems porting an application from one version of Linux to another? Since the team is familiar with .NET, it seems best to use Mono's C#.

Last edited by mrtedweb; 05-18-2009 at 01:47 PM.
 
  


Reply

Tags
com, linux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
putty equivalent in Linux ? concoran Linux - Newbie 7 05-22-2008 05:34 AM
Is there a Linux equivalent to Stickies etotheidotpy Linux - Newbie 2 01-22-2008 11:30 PM
Linux Equivalent of Via Voice? marksgirl Debian 3 12-03-2006 07:14 AM
software equivalent in linux scng Linux - Software 1 09-04-2004 12:21 PM


All times are GMT -5. The time now is 08:24 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration