Menu

#1 Socket class development

open
nobody
5
2004-10-11
2004-10-11
Anonymous
No

I have added following to them:

void Socket::setConditionalAccept(bool enable) throw
(IOError) {
int opt = (enable ? 1 : 0);
int ret = setsockopt(socket_handle(this),
SOL_SOCKET, SO_CONDITIONAL_ACCEPT, (char*)&opt,
sizeof(opt));
if(ret == SOCKET_ERROR)
throw IOError(socket_errno, "Could not set socket
condition accept option", P_SOURCEINFO);
}

void Socket::setRecBuff(size_t size_) throw(IOError) {
int ret = setsockopt(socket_handle(this),
SOL_SOCKET, SO_RCVBUF, (char*)&size_, sizeof(size_));
if(ret == SOCKET_ERROR)
throw IOError(socket_errno, "Could not set socket
receive buffer", P_SOURCEINFO);
}

could you include another options also?

---------
Dmitry

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.