include bound localAddress in Bound message, see #3230

- done for Tcp & Udp in the same way
- also try to fix TcpConnectionSpec on my Mac
This commit is contained in:
Roland 2013-04-13 20:53:52 +02:00
parent d5a658f433
commit 6a4be23d58
10 changed files with 27 additions and 17 deletions

View file

@ -456,8 +456,9 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
assertThisConnectionActorTerminated()
}
// This tets is disabled on windows, as the assumption that not calling accept on a server socket means that
// This test is disabled on windows, as the assumption that not calling accept on a server socket means that
// no TCP level connection has been established with the client does not hold.
// RK: I think Windows is no different than any other OS in this regard, there was just a sleep() missing.
"report failed connection attempt while not accepted" in withUnacceptedConnection() { setup
import setup._
ignoreIfWindows
@ -465,6 +466,9 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
// close instead of accept
localServer.close()
// must give the OS some time to send RST from server to client
Thread.sleep(100)
EventFilter[SocketException](occurrences = 1) intercept {
selector.send(connectionActor, ChannelConnectable)
userHandler.expectMsg(CommandFailed(Connect(serverAddress)))
@ -679,6 +683,7 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
val userHandler = TestProbe()
val selector = TestProbe()
val connectionActor = connectionActorCons(selector.ref, userHandler.ref)
// calling .underlyingActor ensures that the actor is actually created at this point
val clientSideChannel = connectionActor.underlyingActor.channel
selector.expectMsg(RegisterChannel(clientSideChannel, OP_CONNECT))