diff --git a/examples/remote/client/main.go b/examples/remote/client/main.go index 6736bee..c69c7f0 100644 --- a/examples/remote/client/main.go +++ b/examples/remote/client/main.go @@ -15,9 +15,11 @@ func main() { panic(err) } - pid := actor.NewPID("127.0.0.1:4000", "server") + // The server will be started with id "myserverid". Hence, let's create + // the correct PID for it so its reachable. + serverPID := actor.NewPID("127.0.0.1:4000", "server/myserverid") for { - e.Send(pid, &msg.Message{Data: "hello!"}) + e.Send(serverPID, &msg.Message{Data: "hello!"}) time.Sleep(time.Second) } } diff --git a/examples/remote/server/main.go b/examples/remote/server/main.go index 20d26d9..0490e31 100644 --- a/examples/remote/server/main.go +++ b/examples/remote/server/main.go @@ -32,6 +32,6 @@ func main() { panic(err) } - e.Spawn(newServer, "server") + e.Spawn(newServer, "server", actor.WithID("myserverid")) select {} }