Article contains code of Erlang SSL echo server and SSL client example. Code is complete and working. Pattern can be useful in real world projects.
UDP is a widely used protocol and Erlang is a great platform for different network application different kinds. Today I decided to publish small UDP echo server example. I know that UDP socket usage is very simple in Erlang, but I think somebody will find this code usefull.
Some time ago I had to use sockets from Adobe Flash/Flex, so needed a simple one implemented in Erlang. I do not suggest to use it exactly like it listed below, but you may find some idea for your project there. I hope that you know what I am talking about, if you are reading this article, so do not want to waist your time…
PS: Adobe Flash policy server Erlang implementation available (very basic one).
Today I am going to write a brief article about Erlang gen_tcp usage. Probably the reader already has experience with sockets programming. But just to remind server architecture. First of all listening socket should be created, than server is going into accept state waiting for new connection. Once new connection is accepted server creates new thread to process incoming packets. While server waits for another connection.
Erlang NIF (Native Code Functions) example. Basically article shows how to connect the library written in C and compiled with GNU gcc to the erlang code. That is very important when speed optimisation is required for some Erlang code piece. Example is very basic and just shows types conversion between two languages.