There is a multiplayer card game which I had first programmed as a non-forking socket server in C (using poll() call).
Then it was too difficult for me to add new features and I've switched to Perl (using IO::Poll module).
As Perl doesn't support readv()/writev(), requires more memory/CPU and also isn't very commercial (I'd like to sell my game later), I would like to port my server back to C++ in future - once my features stabilize. (C++ this time because there are few objects in my server).
Could anyone please supply me with an example, how to use readv(), writev() and poll() or select() under C++? I know how to use those under Perl and C, but I haven't found any examples for C++ yet.
My environment: I'm using OpenBSD with its gcc/g++ and I'd like my server to run under Linux as well. I'd prefer not to use any unusual libraries (like libevent?) unless they work under Windows too - because maybe in the future I want to port my server to Windows too (for that I think I'll have to switch back from poll() to select() and add few Winsock functions?).
Please let me add that I like both Perl and C and I respect C++ very much, so this question is not about which language or OS is better. My question is: how to use poll() with C++
Thank you! Alex