non-os dependent sockets

Is there a way to create non-os dependent sockets in c++ and if so how would I go about doing it? Or is there something better to use than sockets? just curious...
Ultimately, you get networking by asking the OS nicely. So the short answer is no. A socket is inherently dependent on the OS.

The longer answer is, what's your use-case? If you mean "can I write some code using sockets in C++ that will then compile on Windows and also on Linux" then yes, you can use a cross-platform library.
I'm just trying to find the best socket library to use for my upcoming project and if one work on multiple platforms that would be nice.
btw what socket library would u recommend using?
Re: the "something better to use than sockets" part, what are you trying to do?
Is your upcoming project actually going to be compiled and run on separate platforms? A common source of problems in programming is making things much harder than they need to be in case of things that end up never happening.
@helios send bid amounts data in real time between multiple applications (possibly on different computers)
Last edited on
@repeater yes
I like ZMQ
I found that the difference between windows and unix sockets was just one or 2 very small things, so we fixed it with #ifdef flags. The function names and structures and all used to be virtually identical... not sure if that is still true in .net though. That was back in winsock days.

you can probably also find a port of the unix one that compiles on windows. Like, patch in Cygwin?

Last edited on
I'm with Repeater on this. It's not specifically a sockets library you need. You want a good comms library. And ZeroMQ is excellent at this sort of thing. It's cross platform and fast.

You will need to take the time to look at comms from their perspective, a paradigm shift. But once you get it, it's worth it.
thanks for the input
@Repeater and kbw ill take a look and ZeroMQ
Topic archived. No new replies allowed.