Extract onExecCommand

This commit is contained in:
Dale Wijnand 2017-01-20 16:34:38 +00:00
parent 4b88378c61
commit 1ef59759cc
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
1 changed files with 6 additions and 4 deletions

View File

@ -70,10 +70,12 @@ final class NetworkChannel(val name: String, connection: Socket) extends Command
out.flush()
}
def onCommand(command: CommandMessage): Unit =
command match {
case x: ExecCommand => append(Exec(x.commandLine, x.execId orElse Some(Exec.newExecId), Some(CommandSource(name))))
}
def onCommand(command: CommandMessage): Unit = command match {
case x: ExecCommand => onExecCommand(x)
}
private def onExecCommand(cmd: ExecCommand) =
append(Exec(cmd.commandLine, cmd.execId orElse Some(Exec.newExecId), Some(CommandSource(name))))
def shutdown(): Unit = {
println("Shutting down client connection")