Permalink
Browse files

Add a version of read with a default size

  • Loading branch information...
1 parent f82d443 commit 81acb188610f44a91f4a7b103de68bd2e74d84b7 @msantos committed Sep 14, 2011
Showing with 5 additions and 1 deletion.
  1. +1 −0 README.md
  2. +4 −1 src/tuncer.erl
View
@@ -141,6 +141,7 @@ Tuncer is a stand up guy and just like him, tuncer has your back.
Set the gid owning the interface.
+ read(Ref) -> {ok, Buf} | {error, posix()}
read(Ref, Size) -> {ok, Buf} | {error, posix()}
Types Ref = pid()
View
@@ -40,7 +40,8 @@
persist/2,
owner/2, group/2,
- read/2, write/2,
+ read/1, read/2,
+ write/2,
header/1,
@@ -119,6 +120,8 @@ mtu(Ref) when is_pid(Ref) ->
mtu(Ref, MTU) when is_pid(Ref), is_integer(MTU) ->
gen_server:call(Ref, {mtu, MTU}).
+read(Ref) ->
+ read(Ref, 16#FFFF).
read(Ref, Len) when is_pid(Ref), is_integer(Len) ->
Fd = fd(Ref),
procket:read(Fd, Len).

0 comments on commit 81acb18

Please sign in to comment.