Pass State to NetworkChannel

This commit is contained in:
Dale Wijnand
2017-03-05 13:40:50 +00:00
parent 1ef59759cc
commit 164b0fe830
2 changed files with 2 additions and 2 deletions
@@ -74,7 +74,7 @@ private[sbt] final class CommandExchange {
def onIncomingSocket(socket: Socket): Unit =
{
s.log.info(s"new client connected from: ${socket.getPort}")
val channel = new NetworkChannel(newChannelName, socket)
val channel = new NetworkChannel(newChannelName, socket, s)
subscribe(channel)
channel.publishEventMessage(ChannelAcceptedEvent(channel.name))
}
@@ -10,7 +10,7 @@ import java.util.concurrent.atomic.AtomicBoolean
import sbt.protocol.{ Serialization, CommandMessage, ExecCommand, EventMessage }
import sjsonnew.JsonFormat
final class NetworkChannel(val name: String, connection: Socket) extends CommandChannel {
final class NetworkChannel(val name: String, connection: Socket, state: State) extends CommandChannel {
private val running = new AtomicBoolean(true)
private val delimiter: Byte = '\n'.toByte
private val out = connection.getOutputStream