Attempt to clean up server codebase
This commit is contained in:
parent
678244d289
commit
75dac0ccef
|
@ -90,25 +90,11 @@ func masterReceiver(slaveChannel chan<- string, masterChannel <-chan string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// func receiver(conn net.Conn, ch chan string) {
|
|
||||||
// fmt.Println("THE RECEIVER HAS BEEN STARTED, YOU CAN ONLY SEE THIS MESSAGE ONCE")
|
|
||||||
// receiverIsStarted = false
|
|
||||||
// for {
|
|
||||||
// select {
|
|
||||||
// case otherMessage := <-ch:
|
|
||||||
// conn.Write([]byte(otherMessage))
|
|
||||||
// default:
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
func handleConn(conn net.Conn, slaveChannel <-chan string, masterChannel chan<- string) {
|
func handleConn(conn net.Conn, slaveChannel <-chan string, masterChannel chan<- string) {
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
//var otherMessage string
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
//select {
|
|
||||||
message := <-slaveChannel
|
message := <-slaveChannel
|
||||||
conn.Write([]byte(message))
|
conn.Write([]byte(message))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue