Hi all,

I need a setup involving a client or front-end program that sends some tasks to a back-end process for processing and collects results for output. I know this involves socket programming, but one issue here is that the front-end is a windows program and the back-end is a linux cluster server. Converting the front-end to linux would take too much effort considering I've used some windows functions for convenience. So my question is, how do I implement this? What libraries should I use for both setups? Is the socket programming API standard and therefore cross-platform?


5 Years
Discussion Span
Last Post by darelet

There is nothing preventing you from opening a socket on your windows machine and connecting to a linux machine on the other end. If you want a good introduction to the topic (for both windows and linux) you can search for Beej's guide to networking.
There are also third-party libraries that make this more-or-less a non-issue. Boost, for instance, has libraries for this.


Thanks guys for the speedy and optimistic response. Those third party tools would be glorious as delving into socket programming subtleties would be digressing from my core focus especially given the short time period I need to do this. I've got Beej's guide and am currently checking out Socketlib. Will definitely be back if I run into non-googleable issues..


Hello again,
I found those third party tools too complex and decided to just use the winsock default libraries. Someone tell me, why is not sending of float/double arrays rarely covered in send() operations? It seems like most examples that I see just cover text based (telnet like) operations. I want to share float data between various network nodes and it doesn't look that straight-forward.


I want to share float data between various network nodes and it doesn't look that straight-forward.

You need the help on data representation right ?
the answer is all the networking protocols are using a big-ending method to
store data. But formats like IEEE754 won't be change platform to platform.
so go ahead and convert them to big-ending from little ending. You can write
some simple function like this.

void* little2bigend_32(void *data)
    for (int i=0;i<2;i++)
        unsigned char temp = static_cast<unsigned char>(data[i]);
        data[i] = data [3-i];
        data[3-i] = temp ;


however when we use a format like XML we don't need to deal with this either.


ntoh and hton deals with int data if I'm not wrong! @Nicax64, your example is too vague to implement. Where do I fit it in (assuming I need to send a 900x700 float array)? I'd also appreciate general advice on the best way around this whole issue.. Let me rephrase my situation..

I need to do some computationally expensive mathematical-based tasks (like calculating Hu moments and central moments) on large float arrays over a cluster of computers controlled by a linux running server (which is the back end).
I need a windows front-end for display of results in a graphical manner, as well as acquisition of the float array inputs...

NB: Any simpler but decent libraries (besides boost and socketlib) you guys know about? I have a feeling I might have to resort to that ultimately

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.