Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 21ba173262a7e2eb4e19149dc77a4c734379ff58 1 parent 9d51ae9
@msantos authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  src/bpf.erl
View
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).
Please sign in to comment.
Something went wrong with that request. Please try again.