Added setBlocking to Socket::Server.

This commit is contained in:
Thulinma 2013-04-10 22:18:12 +02:00
parent 89c4e766ed
commit 54a19d60e6
2 changed files with 8 additions and 0 deletions

View file

@ -855,6 +855,13 @@ Socket::Connection Socket::Server::accept(bool nonblock){
return tmp;
}
/// Set this socket to be blocking (true) or nonblocking (false).
void Socket::Server::setBlocking(bool blocking){
if (sock >= 0){
setFDBlocking(sock, blocking);
}
}
/// Close connection. The internal socket is closed and then set to -1.
/// If the connection is already closed, nothing happens.
void Socket::Server::close(){