1
This commit is contained in:
parent
379e4a5b83
commit
ca4bcdb5e2
@ -13,7 +13,7 @@
|
|||||||
#include <a8/a8.h>
|
#include <a8/a8.h>
|
||||||
#include <a8/tcpclient.h>
|
#include <a8/tcpclient.h>
|
||||||
|
|
||||||
const int MAX_RECV_BUFFERSIZE = 1024 * 10;
|
const int MAX_RECV_BUFFERSIZE = 1024 * 64;
|
||||||
|
|
||||||
namespace a8
|
namespace a8
|
||||||
{
|
{
|
||||||
@ -120,6 +120,19 @@ namespace a8
|
|||||||
socket_ = INVALID_SOCKET;
|
socket_ = INVALID_SOCKET;
|
||||||
return false;
|
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;
|
connected_ = true;
|
||||||
if (on_connect) {
|
if (on_connect) {
|
||||||
on_connect(this);
|
on_connect(this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user