File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ public actor Client {
179179 // Start message handling loop
180180 task = Task {
181181 guard let connection = self . connection else { return }
182- repeat {
182+ loop: while true {
183183 // Check for cancellation before starting the iteration
184184 if Task . isCancelled { break }
185185
@@ -207,6 +207,8 @@ public actor Client {
207207 )
208208 }
209209 }
210+ await logger? . debug ( " Client receive stream finished; exiting loop. " )
211+ break loop
210212 } catch let error where MCPError . isResourceTemporarilyUnavailable ( error) {
211213 try ? await Task . sleep ( for: . milliseconds( 10 ) )
212214 continue
@@ -215,7 +217,7 @@ public actor Client {
215217 " Error in message handling loop " , metadata: [ " error " : " \( error) " ] )
216218 break
217219 }
218- } while true
220+ }
219221 await self . logger? . debug ( " Client message handling loop task is terminating. " )
220222 }
221223
You can’t perform that action at this time.
0 commit comments