Re: Linux to WinXP socket communication



Zoinks wrote:
Martin Gregorie wrote:
Zoinks wrote:

I'm trying to code a client-server app. to communicate between a GNU/Linux box and a Windows XP box. The necessity is for very light but very fast communication (probably via a crossover GigE cable). A few bytes are to be sent from the XP box to the Linux box at fixed intervals and in this case timing is crucial.

What is the best cross-platform API for socket type comms?
It must be free and commercially unencumbered of course.

In what programming language?

What are the critical timing limits - latency, interval accuracy or something else?

If you have Java installed in both boxes the use of Socket and ServerSocket classes is probably the most portable solution.



The whole thing will be in C.
Both interval accuracy and predicable latency are key measures.

As Paul says, communication on a dedicated direct cable between Windows and Linux could vary in both interval accuracy and latency because neither are real-time operating systems and hence neither offers deterministic response times to external signals. You need deterministic response times to reduce jitter to the level of a few microseconds.

I just ran a couple of checks with ping to illustrate the point. I used the default interval of one second between pings:

- Client is a 300 MHz laptop running Fedora Core 1
- Server is an 866 MHz desk box running Fedora Core 6
- link is 100 Mbits/second over CAT5 cables with a D-link hub
in the middle
- results:

35 packets transmitted, 35 received, 0% packet loss, time 33999ms
rtt min/avg/max/mdev = 0.057/0.074/0.102/0.010 ms

106 packets transmitted, 106 received, 0% packet loss, time 105012ms
rtt min/avg/max/mdev = 0.057/0.074/0.101/0.015 ms

As you can see, the round trip times can vary by nearly a factor of two (44 microseconds variation) with a standard deviation of 10 to 15 microseconds.

What's the purpose of this connection? If its purely for time synchronization you'd be better off running xntpd on Linux and the equivalent application under Windows. You can get the time standard from the 'net or build a Rugby MSF receiver for under 30 quid.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
.



Relevant Pages

  • Re: Disappearing Driver
    ... - appears in Windows Explorer but does not read CDs ... Use MSCEx *ONLY* in DOS ... There are three cables that apply; ... Are you in DOS compatibility mode? ...
    (microsoft.public.windowsxp.hardware)
  • Re: Cannot transfer files from old computer to new one
    ... > preinstalled Windows XP home edition, and I thought it would be an easy ... I have bought and returned several different cables ... > (Belkin direct cable connection cable, switchbox cable, serial/parallel ... "the files and settings ...
    (microsoft.public.windowsxp.network_web)
  • Re: "drive 1 not found: serial ata, sata-2"
    ... and making sure all cables are firmly secured on both ends... ... RAM, Windows XP Media Center Edition w/ SP2, Geforce 6600 GT, PHILIPS DVD ... One possibility is that something got jarred loose inside the tower when I ...
    (microsoft.public.windows.mediacenter)
  • Cannot transfer files from old computer to new one
    ... preinstalled Windows XP home edition, and I thought it would be an easy task ... I have bought and returned several different cables ... all along I have been trying to run Direct cable connection on my old windows ... "the files and settings ...
    (microsoft.public.windowsxp.network_web)
  • Re: Whats the cost of using hundreds of threads?
    ... > Apache, for example, can easily spawn more threads under Windows, and ... > I've written code that uses 200 threads with excellent performance. ... the default Windows thread stack size is 2 MB. ... deterministic response times good-bye). ...
    (comp.lang.python)