Explorar o código

Merge pull request #299 from paullouisageneau/sctp-recv-loop-state

Check state in SCTP recv loop
Paul-Louis Ageneau %!s(int64=4) %!d(string=hai) anos
pai
achega
f20faed180
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;