|
@ -13,10 +13,11 @@ func TestEcho(t *testing.T) { |
|
|
sockPath := Fmt("unix:///tmp/echo_%v.sock", RandStr(6)) |
|
|
sockPath := Fmt("unix:///tmp/echo_%v.sock", RandStr(6)) |
|
|
|
|
|
|
|
|
// Start server
|
|
|
// Start server
|
|
|
_, err := server.StartListener(sockPath, dummy.NewDummyApplication()) |
|
|
|
|
|
|
|
|
s, err := server.NewServer(sockPath, dummy.NewDummyApplication()) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
Exit(err.Error()) |
|
|
Exit(err.Error()) |
|
|
} |
|
|
} |
|
|
|
|
|
defer s.Stop() |
|
|
// Start client
|
|
|
// Start client
|
|
|
proxy, err := NewRemoteAppConn(sockPath) |
|
|
proxy, err := NewRemoteAppConn(sockPath) |
|
|
if err != nil { |
|
|
if err != nil { |
|
@ -35,10 +36,11 @@ func BenchmarkEcho(b *testing.B) { |
|
|
b.StopTimer() // Initialize
|
|
|
b.StopTimer() // Initialize
|
|
|
sockPath := Fmt("unix:///tmp/echo_%v.sock", RandStr(6)) |
|
|
sockPath := Fmt("unix:///tmp/echo_%v.sock", RandStr(6)) |
|
|
// Start server
|
|
|
// Start server
|
|
|
_, err := server.StartListener(sockPath, dummy.NewDummyApplication()) |
|
|
|
|
|
|
|
|
s, err := server.NewServer(sockPath, dummy.NewDummyApplication()) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
Exit(err.Error()) |
|
|
Exit(err.Error()) |
|
|
} |
|
|
} |
|
|
|
|
|
defer s.Stop() |
|
|
// Start client
|
|
|
// Start client
|
|
|
proxy, err := NewRemoteAppConn(sockPath) |
|
|
proxy, err := NewRemoteAppConn(sockPath) |
|
|
if err != nil { |
|
|
if err != nil { |
|
@ -62,10 +64,11 @@ func BenchmarkEcho(b *testing.B) { |
|
|
func TestInfo(t *testing.T) { |
|
|
func TestInfo(t *testing.T) { |
|
|
sockPath := Fmt("unix:///tmp/echo_%v.sock", RandStr(6)) |
|
|
sockPath := Fmt("unix:///tmp/echo_%v.sock", RandStr(6)) |
|
|
// Start server
|
|
|
// Start server
|
|
|
_, err := server.StartListener(sockPath, dummy.NewDummyApplication()) |
|
|
|
|
|
|
|
|
s, err := server.NewServer(sockPath, dummy.NewDummyApplication()) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
Exit(err.Error()) |
|
|
Exit(err.Error()) |
|
|
} |
|
|
} |
|
|
|
|
|
defer s.Stop() |
|
|
// Start client
|
|
|
// Start client
|
|
|
proxy, err := NewRemoteAppConn(sockPath) |
|
|
proxy, err := NewRemoteAppConn(sockPath) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|