On Tue, Apr 5, 2016 at 5:04 PM, Michi <michael.tha...@physik.tu-muenchen.de> wrote:
> Hi Endre, > > even after 10 Minutes TCPView shows that the socket is still bound by > jawaw.exe. If I close the application, the socket gets unbound immediately. > That's why I am wondering if I do something wrong or if this is a bug in > Akka HTTP. > We use NIO underneath and don't do anything special, so I am not sure what we can do here (it works on all other OSes). > > I tried to use a independent Actor System for the Http Server class and > shut the system down after unbinding, but that does not help either. > At that point Akka had cleaned up every actor, so I am not sure what else to do :( > > Unfortunately our customer uses Windows and I am wondering if there is > anything I can do about it or if it would be better to reimplement the code > with Apache Http Components. > You can try out other frameworks, if they happen to work (and use NIO) then at least we can see what magic they do to make Windows happy :( -Endre > > best regards, > Michael > > On Tuesday, April 5, 2016 at 2:07:52 PM UTC+2, drewhk wrote: >> >> Hi, >> >> As far as I know event though NIO reports the unbind, unbinding on >> Windows is not immediate and you are not guaranteed to be able to bind >> again immediately. I don't know if this comes from Windows or the NIO >> windows drivers though. >> >> -Endre >> >> On Tue, Apr 5, 2016 at 2:05 PM, Michi <michael...@physik.tu-muenchen.de> >> wrote: >> >>> Hi, >>> >>> we have a problem with Akka HTTP on Windows: after creating a server >>> binding and unbinding it, it is not possible to bind it again. We get a >>> akka.stream.BindFailedException. On Linux, this works without problems. >>> >>> The application uses the following code to create the server binding: >>> >>> private val binding: Future[ServerBinding] = { >>> val httpsContext = if (protocol == Protocol.Https) >>> Some(HttpsContexts.serverContext) else None >>> val serverSource: Source[Http.IncomingConnection, >>> Future[Http.ServerBinding]] = Http(actorSystem).bind(interface = interface, >>> port = port, httpsContext = httpsContext) >>> >>> logger.info("Binding to interface " + interface + ":" + port + " >>> using " + protocol) >>> >>> val bindingFuture: Future[ServerBinding] = >>> serverSource.to(Sink.foreach { connection => >>> connection.handleWith(route) >>> }).run() >>> bindingFuture >>> } >>> >>> binding onComplete { >>> case Success(result) => logger.info("Bound to interface " + >>> interface + ":" + port + " using " + protocol) >>> case Failure(reason) => logger.error("Could not bind to interface " >>> + interface + ":" + port + " using " + protocol, reason) >>> } >>> >>> protected override def dispose(): Unit = { >>> // stop webserver >>> for(binding <- binding) { >>> binding.unbind() onComplete { >>> case Success(result) => logger.info("Unbound " + binding) >>> case Failure(reason) => logger.error("Could not unbind " + >>> binding, reason) >>> } >>> } >>> } >>> >>> Restarting the application solves the problem. >>> >>> Is there anything I can do to solve the problem? >>> >>> Thanks, >>> Michael >>> >>> -- >>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>> >>>>>>>>>> Check the FAQ: >>> http://doc.akka.io/docs/akka/current/additional/faq.html >>> >>>>>>>>>> Search the archives: >>> https://groups.google.com/group/akka-user >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Akka User List" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to akka-user+...@googlegroups.com. >>> To post to this group, send email to akka...@googlegroups.com. >>> Visit this group at https://groups.google.com/group/akka-user. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to akka-user+unsubscr...@googlegroups.com. > To post to this group, send email to akka-user@googlegroups.com. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.