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 ⇒
|
"receive data directly when the connection is established" in withUnacceptedConnection() { unregisteredSetup ⇒
|
||||||
import unregisteredSetup._
|
import unregisteredSetup._
|
||||||
|
|
||||||
localServer.configureBlocking(true)
|
@volatile var serverSideChannel: SocketChannel = null
|
||||||
val serverSideChannel = localServer.accept()
|
awaitCond {
|
||||||
serverSideChannel must not be (null)
|
serverSideChannel = localServer.accept()
|
||||||
|
serverSideChannel != null
|
||||||
|
}
|
||||||
|
|
||||||
serverSideChannel.write(ByteBuffer.wrap("immediatedata".getBytes("ASCII")))
|
serverSideChannel.write(ByteBuffer.wrap("immediatedata".getBytes("ASCII")))
|
||||||
serverSideChannel.configureBlocking(false)
|
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 ⇒
|
clientSocketOptions: immutable.Seq[SocketOption] = Nil)(body: RegisteredSetup ⇒ Any): Unit = withUnacceptedConnection(setServerSocketOptions, createConnectionActor(options = clientSocketOptions)) { unregisteredSetup ⇒
|
||||||
import unregisteredSetup._
|
import unregisteredSetup._
|
||||||
|
|
||||||
localServer.configureBlocking(true)
|
@volatile var serverSideChannel: SocketChannel = null
|
||||||
val serverSideChannel = localServer.accept()
|
awaitCond {
|
||||||
|
serverSideChannel = localServer.accept()
|
||||||
|
serverSideChannel != null
|
||||||
|
}
|
||||||
serverSideChannel.configureBlocking(false)
|
serverSideChannel.configureBlocking(false)
|
||||||
|
|
||||||
serverSideChannel must not be (null)
|
serverSideChannel must not be (null)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue