Yes, we can use it as int. Although while testing on windows, it didn't return an error code, which i would have expected, if there were any issues.
If we change this to int for both unix/windows, we will need to change the setsockopt and have ifdef around it to avoid warnings. Optval is char* for windows, so we will need a cast to (char*) around the optval.
int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);
__in SOCKET s,
__in int level,
__in int optname,
__in const char *optval,
__in int optlen
setsockopt(zh->fd, IPPROTO_TCP, TCP_NODELAY, (char*) &on, sizeof(int));
Can you submit a patch for this?