Read a variable number of bytes, 4096 by default

This commit is contained in:
Florent Le Coz
2013-12-23 17:07:43 +01:00
parent e35472a6cb
commit 2ecb637f0c
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -61,11 +61,11 @@ void SocketHandler::set_poller(Poller* poller)
this->poller = poller;
}
void SocketHandler::on_recv()
void SocketHandler::on_recv(const size_t nb)
{
char buf[4096];
ssize_t size = ::recv(this->socket, buf, 4096, 0);
ssize_t size = ::recv(this->socket, buf, nb, 0);
if (0 == size)
{
this->on_connection_close();