Exemplo n.º 1
0
func initServer() {
	server.GhostRun(&server.Options{
		Addr:        fmt.Sprintf("%s:%d", host, port),
		LogfileName: logfile,
		Socket:      socket,
	})
}
Exemplo n.º 2
0
func init() {
	go server.GhostRun(&server.Options{Addr: "localhost:6869"})

	// Wait until server start
	// Yep, ugly. Tell if you know better solution
	time.Sleep(1 * time.Second)
	c = client.New(&client.Options{Addr: "localhost:6869"})
}
Exemplo n.º 3
0
func TestSuccessfullConnect(t *testing.T) {
	go server.GhostRun(&server.Options{Addr: "localhost:6870"})
	time.Sleep(1 * time.Second)

	c, err := ObtainClient("localhost", 6870)
	if err != nil {
		t.Error("Can't connect to test localhost ", err.Error())
	}

	_, err = c.Ping()
	if err != nil {
		t.Error("Error on ping ", err.Error())
	}
}
Exemplo n.º 4
0
func TestSuccessfullSocketConnect(t *testing.T) {
	go server.GhostRun(&server.Options{Addr: "localhost:6871", Socket: "123"})
	time.Sleep(1 * time.Second)

	c, err := ObtainUnixSocketClient("123")
	if err != nil {
		t.Error("Can't connect to test localhost ", err.Error())
	}

	_, err = c.Ping()
	if err != nil {
		t.Error("Error on ping ", err.Error())
	}
	os.Remove("123")
}
Exemplo n.º 5
0
func main() {
	flag.Parse()
	server.GhostRun(&server.Options{Addr: fmt.Sprintf("%s:%d", host, port)})
}
Exemplo n.º 6
0
func init() {
	go server.GhostRun(&server.Options{Addr: "localhost:6868"})

	time.Sleep(1 * time.Second)
	c, _ = ObtainClient("localhost", 6868)
}