Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ping(Pong_PID) ->
- Pong_PID ! {ping, self()},
- receive
- pong ->
- io:format("Ping received pong~n", [])
- end.
- pong() ->
- receive
- {ping, Ping_PID} ->
- io:format("Pong received ping~n", []),
- Ping_PID ! pong
- end.
- start() ->
- Pong_PID = spawn(ping_pong, pong, []),
- spawn(ping_pong, ping, [Pong_PID]).
Add Comment
Please, Sign In to add comment