By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,435 Members | 1,479 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,435 IT Pros & Developers. It's quick & easy.

Is IPC in standard C possible?

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a

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

P: n/a

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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.