Transferring Data Across A Network -- Where Do I Begin?

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I want to learn how to transfer data from one C program to another C
program dynamically. Program #1 receives a live data feed and
partially processes that data. Program #2 completes the data
processing. To make this even more challenging ... I need to do this
transfer across a LAN.

My networking experience consists of a one time installation of a NIC
card and the connecting of two computers. Sharing the internet cable
feed was a snap (easy instructions); however, I struggled for a few
days getting the file transfer working. Thus I am only one step away
from TOTAL novice.

My itsy bitsy network consists of two computers running Win2000. I am
currently using C++.Net to write console applications. Essentially C
style structured programming.

The folks at the C newsgroup said I needed to find networking gurus or
operating system experts ... so here I am posting for the first time
to this group. One person said it sounded like a "sockets" type of
task. If so ... where should I begin? Any book recommendations that
can explain this daunting task in a step-by-step fashion? Another
person suggested INI files could possibly be utilized? Perhaps the
best method is unrelated to either sockets or INI files? My goal is to
get my specific task working, but I also would benefit greatly
learning networking basics. I seem to get lost in this vast topic
easily and hope to initially focus on the type of networking for the
Win2000 set-up I have. It is the only system I have access too and
will be my hands-on learning framework.

I greatly appreciate any guidance, book recommendations, online
tutorial suggestions, etc. Thanks in advance for your help.

-- Tom
 
Thomas,

You could certainly use sockets, but there are a few other options with
the .Net framework. You might look at using SOAP to pass XML or
exposing your application as a web service.

Maybe you could post a bit more information and we can help. Using,
..INI files doesn't sound like a good idea, though, and I would avoid
that if at all possible.

Give me more info and I can point you at some tutorials.

Ryan Hanisco
 
Ryan --

Thank you for offering to point me at some tutorials. :))

That will be a huge help!

I have Microsoft Visual C++.Net on one computer and Visual C++ v6.0 on
another. Both computers are running Win2000. They are networked using
a built in NIC on the newer machine's mother board and a NIC card that
I installed on the older machine. I write console applications. I know
these are very basic in terms of user interface and are certainly not
anywhere near as powerful and flexible as truly object oriented C++
programs. I am mostly a C style structured type of programmer at this
time. In the future, once I have what has been a multi-year project
for me fully functional, I plan to use it as a basis for learning the
details of true object oriented programming style. I also hope to
eventually incorporate several of the GUI benefits of windows
programming in the future. However, for now I am focused on the
program's mathematical methods and inner workings.

Thus I am very basic in my programming knowledge. So basic that I do
not even know which types and categories of details to discuss that
would benefit me the most by allowing you to point me in the best
direction. :(

My guess is that sockets are preferred due to my zero knowledge of XML
and the .Net framework. (Even though the .Net software is installed on
one of my computers.)

My hope is that there are some teaching aids (tutorials, books,
examples, etc.) for older and simpler programming styles. So that I
can learn the basics at my current level and grow into XML and the
..Net framework in the future.

Thus I lightheartedly claim to have "a" totally smooth brain cell
dedicated to networking. I hope to carve it up and hope it multiplies
as this challenge for me become reality.

I am serious about learning, but I don't want to mislead about my
programming skill level. My strengths are in mathematics, numerical
methods, and process design/optimization. (Physical, manufacturing
types of processes ... not high level computer optimizations.)

Thank you for your help.

-- Tom
 
Tom said:
I want to learn how to transfer data from one C program to another C
program dynamically. Program #1 receives a live data feed and
partially processes that data. Program #2 completes the data
processing. To make this even more challenging ... I need to do this
transfer across a LAN.

My networking experience consists of a one time installation of a NIC
card and the connecting of two computers. Sharing the internet cable
feed was a snap (easy instructions); however, I struggled for a few
days getting the file transfer working. Thus I am only one step away
from TOTAL novice.

My itsy bitsy network consists of two computers running Win2000. I am
currently using C++.Net to write console applications. Essentially C
style structured programming.

The folks at the C newsgroup said I needed to find networking gurus or
operating system experts ... so here I am posting for the first time
to this group. One person said it sounded like a "sockets" type of
task. If so ... where should I begin? Any book recommendations that
can explain this daunting task in a step-by-step fashion? Another
person suggested INI files could possibly be utilized? Perhaps the
best method is unrelated to either sockets or INI files? My goal is to
get my specific task working, but I also would benefit greatly
learning networking basics. I seem to get lost in this vast topic
easily and hope to initially focus on the type of networking for the
Win2000 set-up I have. It is the only system I have access too and
will be my hands-on learning framework.

I greatly appreciate any guidance, book recommendations, online
tutorial suggestions, etc. Thanks in advance for your help.

-- Tom

Is it imperative that the second computer reads the data directly from
the network stream? To simplify, could you have the first computer write
the data to a shared file on the second computer at intervals and then
have the second computer poll the file for a change in timestamp? When
ever the timestamp did not match the previous, it could do it's thing.
 
Is it imperative that the second computer reads the data directly from
the network stream? To simplify, could you have the first computer write
the data to a shared file on the second computer at intervals and then
have the second computer poll the file for a change in timestamp? When
ever the timestamp did not match the previous, it could do it's thing.

Thanks Kurt !!

That solution sounds elegant. I will give it a try. I also need to
learn sockets and eliminate the hard drive read/writes eventually. I
could perhaps use a ram disk ... but figuring out sockets would
benefit me in the long run. For now sockets are a very mysterious
subject.

I've been searching for a "best" sockets book. "WinSock 2" is sold out
and another version is suppose to be released at some unspecified
time. The used prices for that book are over $100. Yikes!! If you have
a favorite sockets teaching text book to point me towards ... I'd be
very grateful. Ideally one that shows every step so that I can study
the Windows Programming too. I have been writing console apps and I
think it is time I move into the Windows realm.

Happy Holidays to All.

-- Tom
 
Kurt said:
Is it imperative that the second computer reads the data directly from
the network stream? To simplify, could you have the first computer write
the data to a shared file on the second computer at intervals and then
have the second computer poll the file for a change in timestamp? When
ever the timestamp did not match the previous, it could do it's thing.

That's not always reliable. For some file systems (e.g. NTFS) there
might be a considerable delay (several minutes or more) between the
writing to the file by a program and the updating in the OS records of
the time of the time stamp. Probably because of some optimizations.

That limitation can probably be overcome by using the SetFileTime API
to force an update. Another way to do it is to close the file after
writing and then reopening and appending.

Dov
 
Back
Top