Skip to content

Commit e700101

Browse files
committed
#bugfix: some android devices socket.select wake up compatible.
1 parent fb31cf9 commit e700101

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/async_tcp_client.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ void async_tcp_client::service()
252252
// @pitfall: If still have data to read, only wait 1 millseconds.
253253
get_wait_duration(timeout, this->offset_ > 0 ? MAX_BUSY_DELAY : MAX_WAIT_DURATION);
254254

255-
INET_LOG("socket.select waiting... %ld milliseconds", timeout.tv_sec * 1000 + timeout.tv_usec / 1000);
255+
INET_LOG("socket.select maxfdp:%d waiting... %ld milliseconds", maxfdp_, timeout.tv_sec * 1000 + timeout.tv_usec / 1000);
256256

257-
int nfds = ::select(10000, &(fdss_[read_op]), nullptr, nullptr, &timeout);
257+
int nfds = ::select(maxfdp_, &(fdss_[read_op]), nullptr, nullptr, &timeout);
258258

259259
INET_LOG("socket.select waked up, retval=%d", nfds);
260260

@@ -491,7 +491,7 @@ bool async_tcp_client::connect(void)
491491

492492
this->impl_.set_optval(SOL_SOCKET, SO_REUSEADDR, 1); // set opt for p2p
493493

494-
INET_LOG("connect server: %s:%u succeed, fd=%d interrupterfd=%d", address_.c_str(), port_, impl_.native_handle(), interrupter_.read_descriptor());
494+
INET_LOG("connect server: %s:%u succeed, fd=%d interrupter_fd=%d", address_.c_str(), port_, impl_.native_handle(), interrupter_.read_descriptor());
495495

496496
#if 0 // provided as API
497497
auto endp = this->impl_.local_endpoint();

0 commit comments

Comments
 (0)