Cleaned up disused signal chan from Server

This commit is contained in:
Harry Jeffery 2013-08-23 14:59:32 +01:00
parent d4d1089627
commit 747269aed0

View File

@ -14,7 +14,6 @@ import (
) )
type Server struct { type Server struct {
signalChan chan int
eventChan chan Event eventChan chan Event
running bool running bool
@ -46,7 +45,6 @@ type Event struct {
const ( const (
signalStop int = iota signalStop int = iota
signalDisconnect
) )
const ( const (
@ -71,8 +69,7 @@ var (
) )
func NewServer() (*Server, error) { func NewServer() (*Server, error) {
return &Server{signalChan: make(chan int), return &Server{eventChan: make(chan Event),
eventChan: make(chan Event),
name: "rosella", name: "rosella",
clientMap: make(map[string]*Client), clientMap: make(map[string]*Client),
channelMap: make(map[string]*Channel)}, nil channelMap: make(map[string]*Channel)}, nil
@ -99,12 +96,6 @@ func (s *Server) HandleConnection(conn net.Conn) {
func (s *Server) serverThread() { func (s *Server) serverThread() {
for { for {
select { select {
case s := <-s.signalChan:
if s == signalStop {
//TODO
//Disconnect all clients then return
return
}
case e := <-s.eventChan: case e := <-s.eventChan:
s.handleEvent(e) s.handleEvent(e)
} }