Skip to content

Commit b3a3119

Browse files
committed
Conditionalize streaming for unsupported platforms
1 parent d601907 commit b3a3119

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/MCP/Base/Transports/HTTPClientTransport.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ public actor HTTPClientTransport: Actor, Transport {
177177
}
178178
}
179179
}
180-
180+
181+
#if canImport(FoundationNetworking)
182+
private func connectToEventStream() async throws {
183+
logger.warning("SSE is not supported on this platform")
184+
}
185+
#else
181186
/// Establishes an SSE connection to the server
182187
private func connectToEventStream() async throws {
183188
guard isConnected else { return }
@@ -296,4 +301,5 @@ public actor HTTPClientTransport: Actor, Transport {
296301
}
297302
}
298303
}
304+
#endif
299305
}

0 commit comments

Comments
 (0)