473,466 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is IPC in standard C possible?

Hi folks!

I'm looking for a way to do make a single serverprogram handle request
from one or more client apps.
Even if it sounds a bit stupid I really can't find any good way of
doing this in C without using files. Also named pipes does not seem to
exist in C but I may offcourse be wrong about this.

Jan 1 '07 #1
7 1249

Waxhead wrote:
Hi folks!

I'm looking for a way to do make a single serverprogram handle request
from one or more client apps.
Even if it sounds a bit stupid I really can't find any good way of
doing this in C without using files. Also named pipes does not seem to
exist in C but I may offcourse be wrong about this.
No, c89/90 and c99 do not support such. You can try
comp.unix.programmer

--
aegis

Jan 1 '07 #2

aegis wrote:
Waxhead wrote:
Hi folks!

I'm looking for a way to do make a single serverprogram handle request
from one or more client apps.
Even if it sounds a bit stupid I really can't find any good way of
doing this in C without using files. Also named pipes does not seem to
exist in C but I may offcourse be wrong about this.

No, c89/90 and c99 do not support such. You can try
comp.unix.programmer

--
aegis
Thanks for your help!

Jan 1 '07 #3
"Waxhead" <zo****@online.nowrote in message
news:11**********************@i12g2000cwa.googlegr oups.com...
I'm looking for a way to do make a single serverprogram handle request
from one or more client apps.
Even if it sounds a bit stupid I really can't find any good way of
doing this in C without using files. Also named pipes does not seem to
exist in C but I may offcourse be wrong about this.
Standard C does not acknowledge that more than one program exists, so
therefore it does not provide any mechanisms for IPC.

Your platform likely provides APIs to do this, however. Win32/64 and
POSIX both do, but of course it's off-topic here. Check in a newsgroup
for your particular platform.

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking
--
Posted via a free Usenet account from http://www.teranews.com

Jan 1 '07 #4
Stephen Sprunk wrote:
"Waxhead" <zo****@online.nowrote in message
news:11**********************@i12g2000cwa.googlegr oups.com...
I'm looking for a way to do make a single serverprogram handle request
from one or more client apps.
Even if it sounds a bit stupid I really can't find any good way of
doing this in C without using files. Also named pipes does not seem to
exist in C but I may offcourse be wrong about this.

Standard C does not acknowledge that more than one program exists, so
therefore it does not provide any mechanisms for IPC.

Your platform likely provides APIs to do this, however. Win32/64 and
POSIX both do, but of course it's off-topic here. Check in a newsgroup
for your particular platform.

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking
--
Posted via a free Usenet account from http://www.teranews.com
My problem is that I'm going to run my program on two platforms
(Windows and Linux). This is one of the reasons that I'm searching for
a independent way of doing this.

Jan 1 '07 #5
Waxhead wrote:
My problem is that I'm going to run my program on two platforms
(Windows and Linux). This is one of the reasons that I'm searching for
a independent way of doing this.
Invent a portable interface for communicating to the other program and then write wrapper functions
for the platforms you port the program to...
I think some graphical toolkits also provide uniform IPC interfaces that will work in all the OSs
they run in... see GTK or wxwindows...

But it's off-topic in this NG, anyway...

JJ
Jan 1 '07 #6
Waxhead wrote:
Stephen Sprunk wrote:
.... snip ...
>>
Standard C does not acknowledge that more than one program exists,
so therefore it does not provide any mechanisms for IPC.

Your platform likely provides APIs to do this, however. Win32/64
and POSIX both do, but of course it's off-topic here. Check in a
newsgroup for your particular platform.

My problem is that I'm going to run my program on two platforms
(Windows and Linux). This is one of the reasons that I'm searching
for a independent way of doing this.
You aren't going to succeed. You need an interface module which
knows which system you are compiling for. Go to a suitable
newsgroup for information on how those modules should look.

--
Merry Christmas, Happy Hanukah, Happy New Year
Joyeux Noel, Bonne Annee.
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
Jan 2 '07 #7
"Waxhead" <zo****@online.nowrote in message
news:11**********************@48g2000cwx.googlegro ups.com...
Stephen Sprunk wrote:
>Standard C does not acknowledge that more than one program exists, so
therefore it does not provide any mechanisms for IPC.

Your platform likely provides APIs to do this, however. Win32/64 and
POSIX both do, but of course it's off-topic here. Check in a
newsgroup
for your particular platform.

My problem is that I'm going to run my program on two platforms
(Windows and Linux). This is one of the reasons that I'm searching for
a independent way of doing this.
Windows and POSIX may provide similar mechanisms; for instance most
sockets code is the same between the two, though Windows does require a
few extra calls and has slightly different prototypes for some functions
(like using int instead of size_t). They're close enough that you can
write code that will work on both, with the occasional #ifdef for the
OS-specific cruft.

If you want something more powerful, though, they diverge pretty
rapidly. Your best bet is to find a library that provides wrappers to
various OSes and presents a common API to your code. Obviously, that
limits your program's portability to wherever that library works, but
that may not be an issue for you. If you can't find a suitable library,
then write your own (as described above) and publish it :)

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking
--
Posted via a free Usenet account from http://www.teranews.com

Jan 2 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: Steven T. Hatton | last post by:
Now that I have a better grasp of the scope and capabilities of the C++ Standard Library, I understand that products such as Qt actually provide much of the same functionality through their own...
14
by: E. Robert Tisdale | last post by:
I am a long time subscriber to the comp.lang.c newsgroup. Recently (over the last few years), comp.lang.c subscribers have been citing and quoting ANSI/ISO C standards documents to support their...
32
by: toolmaster | last post by:
Since many of the modern computer languages have built-in namespace features, I can't understand why not add this feature into standard C. I've heard many people complain of the lacking of...
24
by: noridotjabi | last post by:
Why isn't there a Graphical User Interface standard? Think about it for a second. You may say, well evey systems API for GUIs is differnt, but do take into acound: every operating system requires...
21
by: Kannan | last post by:
Its been a while I have done pure C programming (I was coding in C++). Is the following function valid according to standard C? int main(int argc, char *argv) { int x; x = 9; printf("Value...
22
by: David Mathog | last post by:
One thing that keeps coming up in this forum is that standard C lacks many functions which are required in a workstation or server but not possible in an embedded controller. This results in a...
85
by: fermineutron | last post by:
Some compilers support __asm{ } statement which allows integration of C and raw assembly code. A while back I asked a question about such syntax and was told that __asm is not a part of a C...
16
by: Spiros Bousbouras | last post by:
There are several compilers which accept various extensions to the C language and produce native code. But I wonder if there are any which offer the option to translate from C with some extensions...
270
by: jacob navia | last post by:
In my "Happy Christmas" message, I proposed a function to read a file into a RAM buffer and return that buffer or NULL if the file doesn't exist or some other error is found. It is interesting...
16
by: subramanian100in | last post by:
Program 1: --------------- #include <cstdlib> #include <iostream> #include <vector> using namespace std; int main() {
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.