+GSocketError GSocket::GetSockOpt(int level, int optname,
+ void *optval, int *optlen)
+{
+ if (getsockopt(m_fd, level, optname, (char*)optval, (SOCKLEN_T*)optlen) == 0)
+ {
+ return GSOCK_NOERROR;
+ }
+ return GSOCK_OPTERR;
+}
+
+GSocketError GSocket::SetSockOpt(int level, int optname,
+ const void *optval, int optlen)
+{
+ if (setsockopt(m_fd, level, optname, (const char*)optval, optlen) == 0)
+ {
+ return GSOCK_NOERROR;
+ }
+ return GSOCK_OPTERR;
+}