473,804 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

data transfer

Hey,

I need to make two programs I wrote to communicate with each other,
but what's the best way to implement it? Both programs will be running
on the same machine.
I don't want to open sockets and transfer the data 'network style'
because of security issues.

The data transfer is only one way, program A will be sending streams
of data to program B, and program B will output the data.

I thought about using shared memory between the two applications but
how can I make program B to read from memory when program A updates
the allocated memory?

If you have a better idea I'd love to hear it :)
I'm using gcc.
Nov 13 '05 #1
2 2520
socket wrote:
Hey,

I need to make two programs I wrote to communicate with each other,
but what's the best way to implement it? Both programs will be running
on the same machine.
I don't want to open sockets and transfer the data 'network style'
because of security issues.


If the programs are on the same machine, there are no security issues. Just
yank the wire out of the wall, and your security problems are solved.

The ISO C answer is: use the file system. For a whizzier bangier answer, ask
in a newsgroup devoted to your platform; comp.unix.progr ammer,
comp.os.linux.d evelopment.apps , comp.os.ms-windows.program mer.win32, or
whatever.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #2
>I need to make two programs I wrote to communicate with each other,
but what's the best way to implement it? Both programs will be running
on the same machine.
I don't want to open sockets and transfer the data 'network style'
because of security issues.
Then you'd better state the security issues in excruciating detail,
if you're worried about communications between two programs on the
same machine being snooped on. What the heck *CAN* you trust?
If you can't trust all the people with administrative privileges
on that machine you need to find another machine.

One possible way is to pipe data from one program (outputs via
stdout) to the other (reads stdin). How you set up the plumbing
is outside the scope of C but it can be done easily in UNIX shell
syntax. (But guess how that gets implemented on many BSD UNIX
systems? A pair of sockets.) You could also have one program write
into a file and the other one reads it (this is how MS-DOS faked
pipes, and a reasonable way to get around not having real support
for pipes) (and something else can read the file also - security
problem). Another way is to compile the two programs together and
have one call the other. Guess what you can do with a debugger?
Security problem. Another possibility is shared memory, which
requires non-standard functions (such as mmap() or the shm* functions).
Shared memory can be shared by more than two programs. Security
problem.
The data transfer is only one way, program A will be sending streams
of data to program B, and program B will output the data.
This description of the data flow begs for a pipe, if your OS
supports it.
I thought about using shared memory between the two applications but
how can I make program B to read from memory when program A updates
the allocated memory?


You won't find much in C that will help you synchronize two programs
using a shared memory segment to avoid problems such as reading the
data before it's written, or busy waiting (very inefficient on a
multi-tasking system), or deadlock.

Gordon L. Burditt
Nov 13 '05 #3

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

Similar topics

2
3950
by: Simon | last post by:
Hi, I am having a little problem with my PHP - MySQl code, I have two tables (shown below) and I am trying populate a template page with data from both. <disclaimer>Now I would like to say my skills, especially with MySQL are rudimentary</disclaimer> However my code (link below) fails, the nested database call does not return any data and this has me stumped. Any help will be much appreciated. Many thanks in advance
1
2156
by: BijuThomas | last post by:
Complicated - ASP/Security/data transfer/XML doubt In our company Head office we are hosting an intranet server in IIS (Windows 2000) , ASP and Sqlserver back end. We are maintaining our branch accounts at various locations and they are sending monthly reports only. Now we are planning to have a centralised data store at our Head Office so that, all details can be accessed from one place using this intranet.
7
8078
by: Dave | last post by:
We are trying to migrate a MS SQL server app to DB2 8.1 Linux platform. Our database has got about 300+tables with total size - 150 GB We are using MS SQL's BCP utility to extract data from MS SQL's tables and loading into DB2 using DB2's LOAD utility. There are tons of colums of floating point types (singe precion & double precision types) in the database and when extracted using BCP, it generates data only upto 17 digits....
2
20753
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none But the problem occures when i want to send a data with & sign (i.e: Firm=F&B). I try to solve this problem with using boundary, but i failed. Any idea!?
7
17345
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem to get it to work in Visual Basic. I tried coding it once myself from scratch and then modified a class that I found on a newsgroup (referenced below). Both seem to be doing the same thing and neither works (or rather, they seem to work but the...
11
2456
by: E.T. Grey | last post by:
Hi, I have an interesting problem. I have a (LARGE) set of historical data that I want to keep on a central server, as several separate files. I want a client process to be able to request the data in a specific file by specifying the file name, start date/time and end date/time. The files are in binary format, to conserve space on the server (as well as to increase processing time). The data in each file can be quite large, covering...
3
3995
by: David Veeneman | last post by:
I am creating a form on the server that I want to POST to a URL that's being called with Server.Transfer(). What's the simplest way to do that? A little background: I'm programming buttons that link to PayPal's shopping cart. PayPal wants an HTML form with data about the product selected (including price), and they provide sample HTML to create a hidden form to transmit the data when the 'Add to cart' button is clicked. It would be...
5
3220
by: Donald Adams | last post by:
Hi, I will have both web and win clients and would like to page my data. I could not find out how the datagrid control does it's paging though I did find some sample code that says they do it this way, but I can't see these methods as public. BookmarksDataSetTableAdapters.BookmarksTableAdapter bookTA = new BookmarksDataSetTableAdapters.BookmarksTableAdapter(); BookmarkList1.DataSource = bookTA.GetAllBookmarksWrtUser(
0
1555
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, Our asp programs seem to have different behaviors when users use IE and firefox. One of most annoying things is the data disappearing problem in IE but not in firefox.(Note: Sometimes a search program can run much faster in Firefox than in IE, don't know why) For example, I have an internal user interface which they can do different product data entry, the program will use Server.Transfer to different asp program for data
4
7587
by: Andrew Jackson | last post by:
I am writing a newsgroup client. I have the protocol figured out. But I get slow transfer speeds off any of the network objects read the data from For example one of the commands for a news client to use is "XOVER articlenumber-" This return string after string of all the news articles from article number on.... Another newsclient, i wont name names, pulls data down just fine. Using a
0
10356
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10361
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10103
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9179
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7644
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4316
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 we have to send another system
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.