Click to See Complete Forum and Search --> : Realtime data exchange between two computers
yche086
February 6th, 2005, 03:54 PM
For our application we are looking at exchanging data between two computers in realtime, and I'm looking at using the ethernet to achieve this. I have done prorgamming with Visual C++ before, and am somewhat confident with it, but I've never done anything relating to network programming. Is there a step-by-step tutorial that I can find somewhere (book, internet) to get my started on this quickly, or maybe even a sample code?
Basically, it involves one computer to send out 5 numbers, each being a float or double, and the other computer receives these information in realtime, at the next cycle the first computer sents out another 5 numbers, and this process repeats until we tell the program to stop.
Many thanks in advance!
Andreas Masur
February 6th, 2005, 04:02 PM
Well....there is some kind of flaw here...network communications cannot basically happen in real-time. Ethernet connections do not guarantee any kind of reliability, there are many things which can delay the transfer such as collisions.
So...how much 'real-time' do you actually need? What is the maximum time the data can be delayed after the got send?
yche086
February 6th, 2005, 04:11 PM
Oops, sorry for the confusion. What I intend to use is to use the ethernet to connect two computers together ONLY, and not use it in a LAN or something like that.
At present, the update rate is about 50Hz for something that's a few bytes big, I would not expect it to be more than a few hundred Hz. As for the time delay, as long as it does not delay so much that it goes into the second computer the same time as the next set of data, it should be fine.
j0nas
February 6th, 2005, 05:00 PM
Do you have TCP/IP installed on these two machines? (ie do they have IP addresses?)... If so, you can use sockets. Look at the Winsock2 api or BSD socket API (on Unix).
For real-time networking, take a look at Quality of Service (QoS)... Don't know how good the support is on different operating systems.
yche086
February 6th, 2005, 05:17 PM
Do you have TCP/IP installed on these two machines? (ie do they have IP addresses?)... If so, you can use sockets. Look at the Winsock2 api or BSD socket API (on Unix).
Ok I'll have a search for tutorials for winsock2 on the net... thanks for the help!!
Andreas Masur
February 7th, 2005, 03:23 AM
Winsock Programmer's FAQ (http://tangentsoft.net/wskfaq/)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.