瀏覽代碼

Exit SCTP recv loop on disconnected state

Paul-Louis Ageneau 4 年之前
父節點
當前提交
2bae3f62c4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/sctptransport.cpp

+ 1 - 1
src/sctptransport.cpp

@@ -336,7 +336,7 @@ void SctpTransport::doRecv() {
 	std::lock_guard lock(mRecvMutex);
 	--mPendingRecvCount;
 	try {
-		while (true) {
+		while (state() != State::Disconnected && state() != State::Failed) {
 			const size_t bufferSize = 65536;
 			byte buffer[bufferSize];
 			socklen_t fromlen = 0;