Various comments and fixes

This commit is contained in:
Alex Hultman
2018-09-23 18:00:18 +02:00
parent ede5fb304a
commit 7f3753e9db
4 changed files with 111 additions and 57 deletions
+12 -3
View File
@@ -148,7 +148,7 @@ public:
}
/* Drain any socket-buffer while also optionally sending a chunk */
int mergeDrain(std::string_view optionalChunk) {
int mergeDrain(std::string_view optionalChunk = {}) {
// strategy: if we have two parts and both will fit in cork buffer then cork them and recursively send them off
@@ -167,8 +167,17 @@ public:
return write(optionalChunk.data(), optionalChunk.length(), true, 0);
}
void close() {
static_dispatch(us_ssl_socket_close, us_socket_close)((SOCKET_TYPE *) this);
/* These should not be public to the user! */
void timeout(unsigned int seconds) {
static_dispatch(us_ssl_socket_timeout, us_socket_timeout)((SOCKET_TYPE *) this, seconds);
}
void shutdown() {
static_dispatch(us_ssl_socket_shutdown, us_socket_shutdown)((SOCKET_TYPE *) this);
}
SOCKET_TYPE *close() {
return static_dispatch(us_ssl_socket_close, us_socket_close)((SOCKET_TYPE *) this);
}
};