Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Sources/MCP/Base/Transports/HTTPClientTransport.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Logging

#if !os(Linux)
#if !os(Linux) && !os(Windows)
import EventSource
#endif

Expand Down Expand Up @@ -266,7 +266,7 @@ public actor HTTPClientTransport: Transport {
request = requestModifier(request)

do {
#if os(Linux)
#if os(Linux) || os(Windows)
let (responseData, response) = try await session.data(for: request)
try await processResponse(response: response, data: responseData)
#else
Expand Down Expand Up @@ -304,7 +304,7 @@ public actor HTTPClientTransport: Transport {
}
}

#if os(Linux)
#if os(Linux) || os(Windows)
private func processResponse(response: URLResponse, data: Data) async throws {
guard let httpResponse = response as? HTTPURLResponse else {
throw MCPError.internalError("Invalid HTTP response")
Expand Down Expand Up @@ -467,7 +467,7 @@ public actor HTTPClientTransport: Transport {
// MARK: - SSE

private func startListeningForServerEvents() async {
#if os(Linux)
#if os(Linux) || os(Windows)
if streaming {
logger.warning(
"SSE streaming was requested but is not fully supported on Linux. SSE connection will not be attempted."
Expand Down Expand Up @@ -563,7 +563,7 @@ public actor HTTPClientTransport: Transport {
#endif
}

#if !os(Linux)
#if !os(Linux) && !os(Windows)
private func connectToEventStream() async throws {
guard isConnected else {
logger.debug("⚠️ Skipping connectToEventStream - transport not connected")
Expand Down