[erlang-questions] Low Level Socket Example
David Mitchell
monch1962@REDACTED
Wed Aug 13 06:54:58 CEST 2008
If you want a very powerful network toolkit that can do just about
anything conceivable, check out Scapy
(http://www.secdev.org/projects/scapy/).
It's Python, not Erlang, but I doubt that a more
capable/extensible/powerful network toolkit exists short of getting
into e.g. Linux kernel code and tweaking it.
Regards
Dave M.
2008/8/13 Serge Aleynikov <saleyn@REDACTED>:
> If you are interested in learning the details of network protocols,
> Erlang could be your friend for the task as a rapid prototyping
> framework. You have to be aware though that a TCP stack in Erlang will
> not deliver the same performance as the kernel-level stack
> implementation. However it is doable as a proof of concept.
>
> The network driver that comes with Erlang is not suited for this task,
> as it serves as a bridge between TCP/SCTP/UDP protocols and the
> emulator. So if you really have interest in accessing raw sockets,
> you'd need to write a driver in C/C++ to marshal raw packets between
> user-level POSIX API and an Erlang process.
>
> Serge
>
> Marc Eisenbarth wrote:
>>> Why can't you use gen_tcp? Do you really need to implement OS level APIs
>>> in
>>> Erlang? Erlang really isn't the right language for raw socket
>>> manipulation.
>>> Try out C.
>>
>> gen_tcp will do the entire TCP session setup for me, so it's not appropriate for my task. Just because C might be better for this task, doesn't mean it's better for the rest of my program. In fact, there's are at least 2 examples of projects that implement network stacks in Erlang, so at least a few people out there that would disagree with you and instead agree that there is some merit in using Erlang :)
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
More information about the erlang-questions
mailing list