Closed RushOnline closed 9 years ago
Your code is correct! gen_udp:open/2 does not allow non-IP sockets. However bypassing the inet driver and passing the file descriptor directly into an erlang port works:
Socket = erlang:open_port({fd, FD, FD}, [stream, binary]).
Some background here: https://github.com/msantos/inert#alternatives
Thank you! Seems like write C port is much simpler for my task.
Do you mean using a dedicated, external Unix port process? Yes, depending on what you're doing, definitely that can be simpler sometimes.
If I can help with anything, feel free to re-open this issue!
Do you mean using a dedicated, external Unix port process?
Yes, I'm working on communication with specific chip over backplane. "Ethernet" is chip specific too, so I need raw socket. But you code is very good, I was learn many things from it. Thank you again!
I've wrote function to listen raw ethernet packets:
I want to receive messages from this socket:
What I'm doing wrong? Please help!