Example #1
0
func initServer() {
	server.GhostRun(&server.Options{
		Addr:        fmt.Sprintf("%s:%d", host, port),
		LogfileName: logfile,
		Socket:      socket,
	})
}
Example #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"})
}
Example #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())
	}
}
Example #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")
}
Example #5
0
func main() {
	flag.Parse()
	server.GhostRun(&server.Options{Addr: fmt.Sprintf("%s:%d", host, port)})
}
Example #6
0
func init() {
	go server.GhostRun(&server.Options{Addr: "localhost:6868"})

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