Rename ErrorClose event to ErrorClosed
This commit is contained in:
parent
7761b00122
commit
385fd322c9
4 changed files with 8 additions and 8 deletions
|
|
@ -173,7 +173,7 @@ object Tcp extends ExtensionKey[TcpExt] {
|
||||||
case object Aborted extends ConnectionClosed
|
case object Aborted extends ConnectionClosed
|
||||||
case object ConfirmedClosed extends ConnectionClosed
|
case object ConfirmedClosed extends ConnectionClosed
|
||||||
case object PeerClosed extends ConnectionClosed
|
case object PeerClosed extends ConnectionClosed
|
||||||
case class ErrorClose(cause: String) extends ConnectionClosed
|
case class ErrorClosed(cause: String) extends ConnectionClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
class TcpExt(system: ExtendedActorSystem) extends IO.Extension {
|
class TcpExt(system: ExtendedActorSystem) extends IO.Extension {
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ private[io] abstract class TcpConnection(val channel: SocketChannel,
|
||||||
}
|
}
|
||||||
|
|
||||||
def handleError(handler: ActorRef, exception: IOException): Unit = {
|
def handleError(handler: ActorRef, exception: IOException): Unit = {
|
||||||
closedMessage = CloseInformation(Set(handler), ErrorClose(extractMsg(exception)))
|
closedMessage = CloseInformation(Set(handler), ErrorClosed(extractMsg(exception)))
|
||||||
|
|
||||||
throw exception
|
throw exception
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class IntegrationSpec extends AkkaSpec("akka.loglevel = INFO") with IntegrationS
|
||||||
val (clientHandler, clientConnection, serverHandler, serverConnection) = establishNewClientConnection()
|
val (clientHandler, clientConnection, serverHandler, serverConnection) = establishNewClientConnection()
|
||||||
clientHandler.send(clientConnection, Abort)
|
clientHandler.send(clientConnection, Abort)
|
||||||
clientHandler.expectMsg(Aborted)
|
clientHandler.expectMsg(Aborted)
|
||||||
serverHandler.expectMsgType[ErrorClose]
|
serverHandler.expectMsgType[ErrorClosed]
|
||||||
verifyActorTermination(clientConnection)
|
verifyActorTermination(clientConnection)
|
||||||
verifyActorTermination(serverConnection)
|
verifyActorTermination(serverConnection)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
|
||||||
|
|
||||||
abortClose(serverSideChannel)
|
abortClose(serverSideChannel)
|
||||||
selector.send(connectionActor, ChannelReadable)
|
selector.send(connectionActor, ChannelReadable)
|
||||||
connectionHandler.expectMsgType[ErrorClose].cause must be("Connection reset by peer")
|
connectionHandler.expectMsgType[ErrorClosed].cause must be("Connection reset by peer")
|
||||||
// wait a while
|
// wait a while
|
||||||
connectionHandler.expectNoMsg(200.millis)
|
connectionHandler.expectNoMsg(200.millis)
|
||||||
|
|
||||||
|
|
@ -259,8 +259,8 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
|
||||||
abortClose(serverSideChannel)
|
abortClose(serverSideChannel)
|
||||||
writer.send(connectionActor, Write(ByteString("testdata")))
|
writer.send(connectionActor, Write(ByteString("testdata")))
|
||||||
// bother writer and handler should get the message
|
// bother writer and handler should get the message
|
||||||
writer.expectMsgType[ErrorClose]
|
writer.expectMsgType[ErrorClosed]
|
||||||
connectionHandler.expectMsgType[ErrorClose]
|
connectionHandler.expectMsgType[ErrorClosed]
|
||||||
|
|
||||||
assertThisConnectionActorTerminated()
|
assertThisConnectionActorTerminated()
|
||||||
}
|
}
|
||||||
|
|
@ -272,7 +272,7 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
|
||||||
localServer.close()
|
localServer.close()
|
||||||
|
|
||||||
selector.send(connectionActor, ChannelConnectable)
|
selector.send(connectionActor, ChannelConnectable)
|
||||||
userHandler.expectMsgType[ErrorClose].cause must be("Connection reset by peer")
|
userHandler.expectMsgType[ErrorClosed].cause must be("Connection reset by peer")
|
||||||
|
|
||||||
verifyActorTermination(connectionActor)
|
verifyActorTermination(connectionActor)
|
||||||
}
|
}
|
||||||
|
|
@ -288,7 +288,7 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
|
||||||
|
|
||||||
key.isConnectable must be(true)
|
key.isConnectable must be(true)
|
||||||
selector.send(connectionActor, ChannelConnectable)
|
selector.send(connectionActor, ChannelConnectable)
|
||||||
userHandler.expectMsgType[ErrorClose].cause must be("Connection refused")
|
userHandler.expectMsgType[ErrorClosed].cause must be("Connection refused")
|
||||||
|
|
||||||
verifyActorTermination(connectionActor)
|
verifyActorTermination(connectionActor)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue