There is a multi-player card game that I first programmed as a socket server without overlaying C (using the poll () call).
Then it was too difficult for me to add new functions, and I switched to Perl (using the IO :: Poll module).
Since Perl does not support readv () / writev (), it requires more memory / processor, and also not very commercial (I would like to sell my game later), I would like to return my server back to C ++ in the future - as soon as my functions stabilize. (This time C ++, because there are several objects on my server).
Can someone offer me an example how to use readv (), writev () and poll () or select () in C ++? I know how to use the ones found in Perl and C, but I have not yet found examples for C ++.
My environment: I use OpenBSD with my gcc / g ++, and I would like my server to work under Linux. I would prefer not to use any unusual libraries (for example, libevent?), If they do not work under Windows, too, because maybe in the future I want to port my server to Windows as well (for this I think I will have to switch from polling () to select () and add some Winsock functions?).
Please let me add that I like both Perl and C, and I really respect C ++, so this question does not concern which language or OS is better. My question is: how to use poll () with C ++
Thank! Alex