It's not clear what the int
parameter is/means, which is passed to the constructor: is it a port number, a socket handle, or what?
The class seems to be missing some useful functions: including listlisten, accept, connect, send, and recv.
I'm not sure why you have 3 detectError methods: I'd get they're all wrappers around the same WSAGetLastError API.
I don't see how void getSendBufferSize(int)
can get the size: the int
needs to be the return code, or a reference parameter; and perhaps it should be size_t
not int
.
Maybe your 'set option' functions should return bool if they can fail; if they don't return bool then how is the user to know whether they should call the detectError method?