Removed blocking code from TcpConnectionSpec #3064
This commit is contained in:
parent
84ae28c4e9
commit
185771c91d
1 changed files with 11 additions and 5 deletions
|
|
@ -98,9 +98,12 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
|
|||
"receive data directly when the connection is established" in withUnacceptedConnection() { unregisteredSetup ⇒
|
||||
import unregisteredSetup._
|
||||
|
||||
localServer.configureBlocking(true)
|
||||
val serverSideChannel = localServer.accept()
|
||||
serverSideChannel must not be (null)
|
||||
@volatile var serverSideChannel: SocketChannel = null
|
||||
awaitCond {
|
||||
serverSideChannel = localServer.accept()
|
||||
serverSideChannel != null
|
||||
}
|
||||
|
||||
serverSideChannel.write(ByteBuffer.wrap("immediatedata".getBytes("ASCII")))
|
||||
serverSideChannel.configureBlocking(false)
|
||||
|
||||
|
|
@ -662,8 +665,11 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
|
|||
clientSocketOptions: immutable.Seq[SocketOption] = Nil)(body: RegisteredSetup ⇒ Any): Unit = withUnacceptedConnection(setServerSocketOptions, createConnectionActor(options = clientSocketOptions)) { unregisteredSetup ⇒
|
||||
import unregisteredSetup._
|
||||
|
||||
localServer.configureBlocking(true)
|
||||
val serverSideChannel = localServer.accept()
|
||||
@volatile var serverSideChannel: SocketChannel = null
|
||||
awaitCond {
|
||||
serverSideChannel = localServer.accept()
|
||||
serverSideChannel != null
|
||||
}
|
||||
serverSideChannel.configureBlocking(false)
|
||||
|
||||
serverSideChannel must not be (null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue