Skip to content

Instantly share code, notes, and snippets.

@useronym
Created October 26, 2015 10:12
Show Gist options
  • Save useronym/1e995299b0d2d342d766 to your computer and use it in GitHub Desktop.
Save useronym/1e995299b0d2d342d766 to your computer and use it in GitHub Desktop.
send_expect(Send, Expect, Socket) ->
io:format("Sending '~s'~n", [Send]),
ok = enm:send(Socket, Send),
receive
{nnreq, Socket, Expect} ->
io:format("Received '~s'~n", [Expect]);
{nnreq, Socket, Other} ->
io:format("Received UNEXPECTED '~s'~n", [Other])
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment