comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <nobody@noplace.com>
Subject: Re: socket, pipe
Date: Wed, 05 Nov 2003 12:31:23 GMT
Date: 2003-11-05T12:31:23+00:00	[thread overview]
Message-ID: <3FA8ED93.9040607@noplace.com> (raw)
In-Reply-To: 56a4b188.0311040645.64f825f7@posting.google.com

First, it always helps if you can identify your compiler & OS version 
since not all features are present in all places.

For dealing with raw binary data, you probably want to investigate 
Ada.Streams. See your Ada Reference Manual or textbook on that. (Plenty 
of resources on-line) Its the way Ada tends to like to deal with raw 
arrays of bytes and you get plenty of facilities for getting 
"structured" data in and out of them. Streams can be connected up to 
pipes or sockets and there are ways of reading/writing files as well, so 
  they give you lots of choices.

As for the communication link, as other observe, you have lots of 
options. Some compilers have an interface called Win32Ada which will 
give you access to all of the OS calls you'd need to work with Windows. 
If you're already a Windows programmer, it will all look familiar. From 
there, you could use pipes or sockets or any of the usual Windows 
mechanisms. If you don't want to go to that low level (who would?) there 
are lots of packages (mentioned elsewhere, but none of them "Standard" 
as part of Ada) to do things like provide a clean interface to sockets 
or DCOM or whatever you're most familiar with. Depending on exactly what 
you're trying to accomplish, there would be advantages and disadvantages 
for any given approach. I tend to favor sockets because it means you can 
run the apps on any machines you have and the TCP/IP thing tends to be 
portable. Other approaches might be equally (or reasonably) portable, 
but it depends a lot on what you have at the other end.

If you're looking for resources to get the job done, keep asking here 
and someone can likely point you at some freebie (or low cost) code that 
will do what you need. Check the Ada websites for libraries and 
textbooks/tutorials. Lots of help is available at no cost. (Two big ones 
are: http://www.adapower.com/ and http://www.adaworld.com/)

MDC


ghostie wrote:
> I'm quite the Ada newbie.  I'm really a C++ programmer.  But I've been
> tasked with making a change to an Ada application that we have, and
> would appreciate some help getting started.  Please be patient.
> 
> We want our Ada application, while running, to share a lot of binary
> information with a different application, this one written in Matlab. 
> Each applicaton will produce output data which will be used by the
> other application. Both applications will run on Win2K PCs, and they
> may or may not be on the same computer.
> 
> Is this possible?  What would be the best way to do it?  I've tried
> looking up some information but to be honest, I don't understand the
> difference between pipes and sockets and Overlapped I/O and whatever
> else is available, let alone if it is possible to do these things in
> Ada.  All the information I'm finding is either Unix-oriented, or else
> it assumes a moderate level of knowledge (which I don't have).
> My Ada compiler is DACS 4.7.15d.
> 
> TIA


-- 
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jsf.mil/NSFrames.htm

Send Replies To: m   o   d   c @ a   m   o   g
                    c   n   i       c   .   r

     "So if I understand 'The Matrix Reloaded' correctly, the Matrix is
     basically a Microsoft operating system - it runs for a while and
     then crashes and reboots. By design, no less. Neo is just a
     memory leak that's too hard to fix, so they left him in... The
     users don't complain because they're packed in slush and kept
     sedated"

         --  Marin D. Condic
======================================================================




  parent reply	other threads:[~2003-11-05 12:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-04 14:45 socket, pipe ghostie
2003-11-04 15:14 ` Ole-Hjalmar Kristensen
2003-11-04 15:33 ` Marius Amado Alves
2003-11-04 17:45   ` Warren W. Gay VE3WWG
2003-11-04 18:48 ` John Woodruff
2003-11-05  3:27 ` Steve
2003-11-05  5:24   ` tmoran
2003-11-05  9:44 ` Pascal Obry
2003-11-05 12:31 ` Marin David Condic [this message]
2003-11-05 14:50   ` Steve
2003-11-05 15:19   ` Steve
2003-11-05 13:45 ` ghostie
2003-11-05 18:54   ` ghostie
2003-11-05 20:41     ` Robert Spooner
2003-11-05 20:18   ` Martin Dowie
2003-11-05 20:23     ` Martin Dowie
2003-11-05 13:54 ` ghostie
2003-11-05 14:26   ` Marius Amado Alves
2003-11-05 23:55   ` Jacob Sparre Andersen
  -- strict thread matches above, loose matches on Subject: below --
2003-11-05 18:49 Beard, Frank Randolph CIV
2003-11-05 19:43 Beard, Frank Randolph CIV
2003-11-05 21:14 ` tmoran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox