Skip to content

Instantly share code, notes, and snippets.

@nox
Created December 25, 2010 15:49
Show Gist options
  • Save nox/754921 to your computer and use it in GitHub Desktop.
Save nox/754921 to your computer and use it in GitHub Desktop.
read_list(Socket, 0, _ReadFun, Values) ->
{ok, {_Number, <<254, _Rest/binary>>}} = ex_mysql_tcp:recv(Socket),
lists:reverse(Values);
read_list(Socket, Count, ReadFun, Values) ->
{ok, {_Number, Bytes}} = ex_mysql_tcp:recv(Socket),
read_list(Socket, Count - 1, ReadFun, [ReadFun(Bytes) | Values]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment