(conn net.Conn)
| 169 | } |
| 170 | |
| 171 | func (srv *Server) handleConnection(conn net.Conn) (err error) { |
| 172 | if conn != nil { |
| 173 | defer conn.Close() |
| 174 | } |
| 175 | command, _, err := bufio.NewReader(conn).ReadLine() |
| 176 | if err != nil { |
| 177 | return err |
| 178 | } |
| 179 | return srv.onServerCommand(string(command), bufio.NewWriter(conn)) |
| 180 | } |
| 181 | |
| 182 | // onServerCommand responds to a user's interactive command |
| 183 | func (srv *Server) onServerCommand(command string, writer *bufio.Writer) (err error) { |
no test coverage detected