This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #both protopath and protos need to use the relative path. | |
| #otherwise you will see this protobuf compiler message: | |
| #You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix | |
| #of the .proto file names -- protoc is too dumb to figure out when two paths | |
| # (e.g. absolute and relative) are equivalent (it's harder than you think). | |
| PROTOPATH += ../../../../common/protocols/protos #this is the folder contains *.proto | |
| PROTOPATHS = | |
| for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p} | |
| PROTOS += ../../../../common/protocols/protos/xxx.proto #the actual *.proto files need to be compiled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setTcpKeepalive(SOCKET &sockfd) | |
| { | |
| const uint32_t keepaliveIntervalSec = 10; | |
| #ifdef _WIN32 | |
| tcp_keepalive keepaliveParams; | |
| DWORD ret = 0; | |
| keepaliveParams.onoff = 1; | |
| keepaliveParams.keepaliveinterval = keepaliveParams.keepalivetime = keepaliveIntervalSec * 1000; | |
| WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, &keepaliveParams, sizeof(keepaliveParams), NULL, 0, &ret, NULL, NULL); |
NewerOlder