?
Solved

Passing parameters between 2 programmes

Posted on 2003-02-18
7
Medium Priority
?
176 Views
Last Modified: 2010-04-15
Hi,

I'm working on a client and server programme and I wanna pass parameters between the two programmes, does anyone know how to write it or what functions should I use? Actually I don't want any TCP stuff, it's kinda too complicated. I want the simplest one, just enough to exchange information between two programmes will be fine. It'll be real good if u have some source codes, hehe. Thanz.

Franky
0
Comment
Question by:franklyflee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 8

Accepted Solution

by:
akshayxx earned 80 total points
ID: 7979529
if you think TCP is a bit too complicated .. then u'll find other ways of interprocess communication also not that easy.
btw what OS and compiler r you working on?
here are some methods to for IPC  on UNIX like systems
shared memory,
message queues,
named pipes,
file system ( esp /proc file system)
and obviously sockets.
i might have missed some names , but these are the most common

0
 
LVL 4

Expert Comment

by:pankajtiwary
ID: 7980508
To exchange data between two programs or rather processes, you need to implement IPC (Interprocess Communication). There are ways to do that.

1. Pipes
2. Semaphores
3. Message queues
4. Shares Memory

I think the simplest will be the 'pipes'. A pipe is simply a kind of connection through which the data flows across two process.
A pipe can be easily be opened in Unix using popen() system call in read or write mode. A pipe opening in read mode means you are sucking the data from the pipe. Whereas write mode means you are using it to take the data out of your process.
More information can be found from the Unix man pages.
0
 

Author Comment

by:franklyflee
ID: 7997148
Oh...pipes.....so do any of u guys have source codes on it? hehe. Well, i'm searching for some now. Actually I'm doing a project on smart card and I need to exchange information between those two programs "Card" and "Reader". Th project is not really about connection, port, socket or anything like that, so I think I'll use the simplest one. That's the pipes right? Ok...Thanz really.

Franky
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:franklyflee
ID: 7997202
And yes I'm using cygwin to compile the C programme. It's always getting me into trouble coz it's always saying it cannot recognize some of the libraries. Anywayz, the platform is Windows XP. I think I can still use those programmes in UNIX, is that right? Ok, so I'll get back to my search on the source codes, hehe.

Franky
0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 8014951
I think the TCP/IP interface is the easiest one. Others are bit complicated, as other people have said, INTERPROCESS COMMUNICATION and all.

Better you go through the sockets interface it is very easy, as easy as using a file. The interface is quite similer to that. Check it out.

Thank you
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10004330
Nothing has happened on this question in over 10 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by akshayxx.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question