1
This commit is contained in:
parent
379e4a5b83
commit
ca4bcdb5e2
@ -13,7 +13,7 @@
|
||||
#include <a8/a8.h>
|
||||
#include <a8/tcpclient.h>
|
||||
|
||||
const int MAX_RECV_BUFFERSIZE = 1024 * 10;
|
||||
const int MAX_RECV_BUFFERSIZE = 1024 * 64;
|
||||
|
||||
namespace a8
|
||||
{
|
||||
@ -120,6 +120,19 @@ namespace a8
|
||||
socket_ = INVALID_SOCKET;
|
||||
return false;
|
||||
}
|
||||
//set nodelay
|
||||
{
|
||||
int flag = 1;
|
||||
int ret = ::setsockopt(socket_,
|
||||
IPPROTO_TCP,
|
||||
TCP_NODELAY,
|
||||
(char *)&flag,
|
||||
sizeof(flag));
|
||||
assert(ret >= 0);
|
||||
if (ret < 0) {
|
||||
abort();
|
||||
}
|
||||
}
|
||||
connected_ = true;
|
||||
if (on_connect) {
|
||||
on_connect(this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user