=act #15265 Make TcpConnection handle Suspend/ResumeReading while waiting for Register
This commit is contained in:
parent
e282ec98c6
commit
40384ae21f
1 changed files with 7 additions and 1 deletions
|
|
@ -55,10 +55,16 @@ private[io] abstract class TcpConnection(val tcp: TcpExt, val channel: SocketCha
|
|||
if (TraceLogging) log.debug("[{}] registered as connection handler", handler)
|
||||
|
||||
val info = ConnectionInfo(registration, handler, keepOpenOnPeerClosed, useResumeWriting)
|
||||
if (!pullMode) doRead(info, None) // immediately try reading
|
||||
doRead(info, None) // immediately try reading, pullMode is handled by readingSuspended
|
||||
context.setReceiveTimeout(Duration.Undefined)
|
||||
context.become(connected(info))
|
||||
|
||||
case ResumeReading ⇒
|
||||
readingSuspended = false
|
||||
|
||||
case SuspendReading ⇒
|
||||
readingSuspended = true
|
||||
|
||||
case cmd: CloseCommand ⇒
|
||||
val info = ConnectionInfo(registration, commander, keepOpenOnPeerClosed = false, useResumeWriting = false)
|
||||
handleClose(info, Some(sender()), cmd.event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue