{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka/issues/16865","labels_url":"https://api.github.com/repos/akka/akka/issues/16865/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka/issues/16865/comments","events_url":"https://api.github.com/repos/akka/akka/issues/16865/events","html_url":"https://github.com/akka/akka/issues/16865","id":57445054,"number":16865,"title":"Windows: Akka HTTP client cannot make two requests on the same connection","user":{"login":"RichardBradley","id":1265780,"avatar_url":"https://avatars.githubusercontent.com/u/1265780?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardBradley","html_url":"https://github.com/RichardBradley","followers_url":"https://api.github.com/users/RichardBradley/followers","following_url":"https://api.github.com/users/RichardBradley/following{/other_user}","gists_url":"https://api.github.com/users/RichardBradley/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardBradley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardBradley/subscriptions","organizations_url":"https://api.github.com/users/RichardBradley/orgs","repos_url":"https://api.github.com/users/RichardBradley/repos","events_url":"https://api.github.com/users/RichardBradley/events{/privacy}","received_events_url":"https://api.github.com/users/RichardBradley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-12T10:54:36Z","updated_at":"2015-02-12T11:12:20Z","closed_at":null,"body":"On Windows 7, the following test fails with message \"'1' is not equal to '2'\"\r\nThe test passes on Mac OSX and RHEL 6.5.\r\nThe libraries used were Java 1.6.0_20 64-Bit, Scala 2.11.4 and akka-http-experimental 1.0-M3.\r\n\r\n```\r\n\r\nimport akka.actor.ActorSystem\r\nimport akka.http.Http\r\nimport akka.http.model.{HttpRequest, HttpResponse, StatusCodes}\r\nimport akka.stream.ActorFlowMaterializer\r\nimport akka.stream.scaladsl.{Sink, Source}\r\nimport org.specs2.mutable.Specification\r\nimport org.specs2.time.NoTimeConversions\r\nimport scala.concurrent.Await\r\nimport scala.concurrent.duration._\r\n\r\nclass ReuseConnectionSpec\r\n  extends Specification\r\n  with NoTimeConversions {\r\n\r\n  \"two requests on the same connection\" should {\r\n    \"give two responses\" in {\r\n\r\n      val responses = sendRequestsOnSameConnection(\r\n        \"example.com\",\r\n        HttpRequest(uri = \"/\"),\r\n        HttpRequest(uri = \"/\"))\r\n\r\n      responses.length mustEqual 2\r\n      responses must beLike {\r\n        case List(first, second) =>\r\n          first.status mustEqual StatusCodes.OK\r\n\r\n          second.status mustEqual StatusCodes.OK\r\n      }\r\n    }\r\n  }\r\n\r\n  private implicit val system = ActorSystem()\r\n  private implicit val fm = ActorFlowMaterializer()\r\n\r\n  private def sendRequestsOnSameConnection(\r\n    hostname: String,\r\n    requests: HttpRequest*\r\n  ): List[HttpResponse] = {\r\n\r\n    val http = Http()\r\n    val connection = http.outgoingConnection(hostname)\r\n\r\n    val responses = Source(requests.toList)\r\n      .via(connection.flow)\r\n      .runWith(Sink.fold(List[HttpResponse]())(_ :+ _))\r\n\r\n    Await.result(responses, 10.seconds)\r\n  }\r\n}\r\n```\r\n\r\nSee https://groups.google.com/forum/#!topic/akka-user/Cw-cx1BnHDk"},"comment":{"url":"https://api.github.com/repos/akka/akka/issues/comments/74054546","html_url":"https://github.com/akka/akka/issues/16865#issuecomment-74054546","issue_url":"https://api.github.com/repos/akka/akka/issues/16865","id":74054546,"user":{"login":"RichardBradley","id":1265780,"avatar_url":"https://avatars.githubusercontent.com/u/1265780?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardBradley","html_url":"https://github.com/RichardBradley","followers_url":"https://api.github.com/users/RichardBradley/followers","following_url":"https://api.github.com/users/RichardBradley/following{/other_user}","gists_url":"https://api.github.com/users/RichardBradley/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardBradley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardBradley/subscriptions","organizations_url":"https://api.github.com/users/RichardBradley/orgs","repos_url":"https://api.github.com/users/RichardBradley/repos","events_url":"https://api.github.com/users/RichardBradley/events{/privacy}","received_events_url":"https://api.github.com/users/RichardBradley/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T11:12:20Z","updated_at":"2015-02-12T11:12:20Z","body":"I thought this might be because the unread first response was blocking the TCP stream, but that ought to result in a timeout exception rather than a list of length 1.\r\n\r\nAlso, adding \"toStrict\" in the \"fold\" doesn't change the behaviour AFAICT.\r\n\r\n"}}