Skip to content
Browse files

bpf: set immediate mode by default

In bpf:open/1, set immediate mode. The BIOCIMMEDIATE flags allows
a read to return immediately after a packet is received by the bpf
device, rather than waiting for the timeout to be reached (which
is set to 0/inifinity) or the bpf buffer to fill.
  • Loading branch information...
1 parent 9d51ae9 commit 21ba173262a7e2eb4e19149dc77a4c734379ff58 @msantos committed Apr 21, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/bpf.erl
3 src/bpf.erl
@@ -426,5 +426,8 @@ init(Socket, Dev) ->
% Return packets sent from the interface
{ok, _} = ctl(Socket, seesent, true),
+ % Return packets immediately (do wait until full buffer)
+ {ok, _} = ctl(Socket, immediate, true),
% Get bpf buf len
ctl(Socket, blen).

0 comments on commit 21ba173

Please sign in to comment.
Something went wrong with that request. Please try again.