func handleConnection(c net.Conn) { buffer := make([]byte, 2048) _, err := c.Read(buffer) if err != nil { fmt.Printf("ERROR on read\n") } solvable, solution := minisat.SolveDIMACS(string(buffer)) if solvable { c.Write(writeSolution(solution)) } else { c.Write([]byte("0\n")) } c.Close() }
func test1() { fmt.Printf("TEST 1\n***\n") problem := "1 0\n-1 2 0\n2 0" solvable, _ := minisat.SolveDIMACS(problem) fmt.Printf("Solvable: %t\n", solvable) }