remove unused var and method
This commit is contained in:
parent
2b9b31ef4c
commit
679791dd63
@ -68,7 +68,6 @@ namespace ix
|
|||||||
const int WebSocketTransport::kDefaultPingIntervalSecs(-1);
|
const int WebSocketTransport::kDefaultPingIntervalSecs(-1);
|
||||||
const int WebSocketTransport::kDefaultPingTimeoutSecs(-1);
|
const int WebSocketTransport::kDefaultPingTimeoutSecs(-1);
|
||||||
const bool WebSocketTransport::kDefaultEnablePong(true);
|
const bool WebSocketTransport::kDefaultEnablePong(true);
|
||||||
const int WebSocketTransport::kClosingMaximumWaitingDelayInMs(100);
|
|
||||||
constexpr size_t WebSocketTransport::kChunkSize;
|
constexpr size_t WebSocketTransport::kChunkSize;
|
||||||
|
|
||||||
const uint16_t WebSocketTransport::kInternalErrorCode(1011);
|
const uint16_t WebSocketTransport::kInternalErrorCode(1011);
|
||||||
@ -88,7 +87,6 @@ namespace ix
|
|||||||
_closeRemote(false),
|
_closeRemote(false),
|
||||||
_enablePerMessageDeflate(false),
|
_enablePerMessageDeflate(false),
|
||||||
_requestInitCancellation(false),
|
_requestInitCancellation(false),
|
||||||
_closingTimePoint(std::chrono::steady_clock::now()),
|
|
||||||
_enablePong(kDefaultEnablePong),
|
_enablePong(kDefaultEnablePong),
|
||||||
_pingIntervalSecs(kDefaultPingIntervalSecs),
|
_pingIntervalSecs(kDefaultPingIntervalSecs),
|
||||||
_pingTimeoutSecs(kDefaultPingTimeoutSecs),
|
_pingTimeoutSecs(kDefaultPingTimeoutSecs),
|
||||||
@ -245,13 +243,6 @@ namespace ix
|
|||||||
return now - _lastReceivePongTimePoint > std::chrono::seconds(_pingTimeoutSecs);
|
return now - _lastReceivePongTimePoint > std::chrono::seconds(_pingTimeoutSecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebSocketTransport::closingDelayExceeded()
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(_closingTimePointMutex);
|
|
||||||
auto now = std::chrono::steady_clock::now();
|
|
||||||
return now - _closingTimePoint > std::chrono::milliseconds(kClosingMaximumWaitingDelayInMs);
|
|
||||||
}
|
|
||||||
|
|
||||||
WebSocketTransport::PollPostTreatment WebSocketTransport::poll()
|
WebSocketTransport::PollPostTreatment WebSocketTransport::poll()
|
||||||
{
|
{
|
||||||
PollResultType pollResult = _socket->poll(_pingIntervalOrTimeoutGCDSecs);
|
PollResultType pollResult = _socket->poll(_pingIntervalOrTimeoutGCDSecs);
|
||||||
@ -333,7 +324,7 @@ namespace ix
|
|||||||
_socket->close();
|
_socket->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_readyState == CLOSING /*&& closingDelayExceeded()*/)
|
if (_readyState == CLOSING)
|
||||||
{
|
{
|
||||||
// close code and reason were set when calling close()
|
// close code and reason were set when calling close()
|
||||||
_socket->close();
|
_socket->close();
|
||||||
@ -935,10 +926,6 @@ namespace ix
|
|||||||
_closeWireSize = closeWireSize;
|
_closeWireSize = closeWireSize;
|
||||||
_closeRemote = remote;
|
_closeRemote = remote;
|
||||||
}
|
}
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(_closingTimePointMutex);
|
|
||||||
_closingTimePoint = std::chrono::steady_clock::now();
|
|
||||||
}
|
|
||||||
setReadyState(CLOSING);
|
setReadyState(CLOSING);
|
||||||
|
|
||||||
_socket->wakeUpFromPoll(Socket::kSendRequest);
|
_socket->wakeUpFromPoll(Socket::kSendRequest);
|
||||||
|
@ -168,11 +168,7 @@ namespace ix
|
|||||||
|
|
||||||
// Used to cancel dns lookup + socket connect + http upgrade
|
// Used to cancel dns lookup + socket connect + http upgrade
|
||||||
std::atomic<bool> _requestInitCancellation;
|
std::atomic<bool> _requestInitCancellation;
|
||||||
|
|
||||||
mutable std::mutex _closingTimePointMutex;
|
|
||||||
std::chrono::time_point<std::chrono::steady_clock>_closingTimePoint;
|
|
||||||
static const int kClosingMaximumWaitingDelayInMs;
|
|
||||||
|
|
||||||
// Constants for dealing with closing conneections
|
// Constants for dealing with closing conneections
|
||||||
static const uint16_t kInternalErrorCode;
|
static const uint16_t kInternalErrorCode;
|
||||||
static const uint16_t kAbnormalCloseCode;
|
static const uint16_t kAbnormalCloseCode;
|
||||||
|
Loading…
Reference in New Issue
Block a user