[Erlang crisis] (4.3) SSH daemon, erlangsshOriginal article, reprinted please indicate the source: Server non-amateur research http://blog.csdn.net/erlib author SunfaceE-mail: cto@188.comSSH Daemon
Erlang/OTP comes shipped with an SSH implementation that can both act as a server and a client. Part of it is a demo application providing a remote shell working in Erlang.To get this to work, you usually need to
1. Download Erlang r16b02 Source Pack
Http://www.erlang.org/download/otp_src_R16B02.tar.gz
2. Because Java is needed in the process of compiling Erlang, the JDK is installed and the corresponding environment variables are configured, using the Jdk-6u45-linux-x64.bin
wget--no-cookies--header "cookie:gpw_e24=http%3a%2f%2fwww.oracle.com%2f" Http://download.oracle.com/otn-pub/java /jdk/6u45-b06/jdk-6u45-linux-x
Reprinted: http://lenary.co.uk/erlang/2011/08/erlang-web-libraries/
I'll try to keep this updated as more information comes to light. please email me if anything is factually incorrect.
Recently I needed to compare a few Erlang web libraries and frameworks for a friend who was writing a simple internal API endpoint. He suggested I shoshould publish the rundown f
through gen_tcp: Listen (). In this case, {active, false} is blocked, and then enters the acceptor_loop to start loop listening to client TCP requests. This cycle mainly involves three processes:
1. gen_accept () generates socket;
2. gen_tcp: controlling_process () assigns the socket communication to the newly generated transport process for processing;
3. set the {active, once} of transport to start receiving the message -- handle_info ({tcp, socket, Bin}, state) after the message is rece
Label: Erlang tail recursion Erlang generative Erlang list set deduplication% Set deduplication. ACC is initially passed into [] and stores the final result.Delsame ([], ACC)-> ACC;Delsame ([pre | T], ACC)-> checksame ([x | x % IntersectionCrosslist (L1, L2)->[X | x % UnionMergelist (L1, L2)->Delsame (lists: Merge (L1, L2), []).Conclusion: (1) the
IntroductionCharacterizing the scalability of Erlang.VMOn kernel-core processorsExplanation:
Erlang schedulers are based on execution ction counting as a method for measuring execution time. A function is roughly equivalent to a function call. since each function call may take a different amount of time, the actual periods are not the same between different functions. when a process is scheduled to run, it is assigned a number of functions that it
1.1. High concurrency
1. Process
The smallest Execution Unit of Erlang is a process, and the biggest feature of the process is good isolation (with its own independent memory space, crash will not affect other work units ).
Erlang process features
2. coroutine
Switch by yourself
Efficient. Because the system context (such as page tables) is not frequently switched, the efficiency
Create a new. Erlang File:Io:format ("consulting. Erlang in ~p~n", [Element (2, FILE:GET_CWD ())]).C:CD ("C:/erl5.7.2/work"). % Note is the symbol "/" instead of "\". The catalogue changes according to individual needsIo:format ("Now in:~p~n", [Element (2, FILE:GET_CWD ())]).To view the properties of the Erlang executable program:For example, my environment:Erlan
Variablethe variable must start with an uppercase letter. in Erlang, variables are like those in math. When associating a value with a variable, it is an assertion, that is, a statement of fact. This variable is the value, that's all.Two assumptions about the simple statement of x=1234.
First, x is not a variable, it's not a concept that you're used to in Java and C languages.
Second, = is not an assignment operator, b
Do you want to learn Erlang! I feel that erlang is the future direction of multi-thread concurrent multi-core open-source is his advantage. if you want to work with us, please visit http://groups.csdn.net/erlang. no error. if you want to learn Erlang, please join us!
I feel that e
original articles, reproduced please specify the Source: Server non-amateur research http://blog.csdn.net/erlib author SunfaceContact e-mail: [Email protected]ProcessesTrying to get a global view of processes was helpful when Trying to assess what much work was being done in the VMS in terms O F Tasks. A general good practice in Erlang are to use processes for truly concurrent activities-on Web servers, you'll usually g ET one process per request or c
In the previous article, the registration process associated atoms have global scope, where the global refers to the current Erlang virtual machine, in the distributed, is the current distributed node. Therefore, registering the process-associated atoms in one node cannot be used directly in another node, but must be used with the target node.
Copy Code code as follows:
{regname, Node}! {messages}.
Example
Start a Server node f
Baidu Cloud push to send official address Http://developer.baidu.com/wiki/index.php?title=docs/cplat/push
Simple introduction of the following principle:
Baidu Cloud push sends support for iOS and Android cloud push. Android support is good, but iOS is generally difficult to tune. Baidu Cloud for the iOS push, he just did a middle agent, to provide users with the interface, the advantage is to use Baidu Cloud Push, Android and iOS can be unified management; The disadvantage is: the communicati
PI is calculated mainly by Monte Carlo method. The code is as follows:1) pi.pl: $time 1 = Time (), foreach (1..20000000) { my ($x, $y) = (rand (), Rand ()); if (sqrt ($x * * 2 + $y * * 2) The Perl script runs as follows, and the average execution time for 20 million times is about 27 seconds: 2) pi.py Import randomimport Datetimeimport mathstarttime = Datetime.datetime.now () total = 0for I in Xrange (20000000): x, y = r Andom.random (), Random.random () if MATH.SQRT (x * * 2 + y * 2)
Compiling source code
Download source code from Erlang website
$ wget http://erlang.org/download/otp_src_19.1.tar.gzInstallation dependencies
$ sudo yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf gitUnzip the first step of the download source code
$ tar zxvf otp_src_19.1.tar.gzInstallation
$ CD opt_src_19.1$./otp_build autoconf$./configure make sudo make installVerify
$ erlInstall from Fedora Library (not recomme
This article describes how to set the Erlang environment of Emacs and how to use common shortcut keys.
1. Download and install Emacs
The http://ftp.gnu.org/gnu/windows/emacs/ has an EXE file download at the bottom of the page.
2. Configure the Erlang plug-in
If Erlang has been installed$ (Erl_home) \ Lib \ tools-2.6.6.6 \ EmacsEmacs plug-in. (It is said tha
# The title may be confusing. In fact, I am not pleasing to the eye. "Color" refers to Beijing dialect, which is generally "unique. To say that one person is "a color", most of them are not praise, but negative loss. # Is an operator in Erlang syntax. Therefore, the title indicates the unique Erlang operator #. I noticed that # is the result of reading programming with
I. Variables
1. The variable [Single Assignment] in Erlang means that the variable can be assigned only once.
2. The variable must start with an uppercase letter.
Ii. Atom
The atom is equivalent to the enumeration type in C ++, but the value of the atom in Erlang is itself.
An atom is a string starting with a lower-case letter. However, if it is enclosed by single quotes, it doesn't matter if it is named. A
Erlang provides binary_to_term to convert binary data into original Erlang data. However, this function also has side effects. If you directly perform a binary_to_term operation on the data transmitted from the peer end, the VM crash may be dropped.
Binary_to_term side effects
This is because binary_to_term generates these atoms when binary data has Atomic values. However, the total number of VM atoms is li
Erlang Cowboy WebSocket ServerThe original text is:Http://marcelog.github.io/articles/erlang_websocket_server_cowboy_tutorial.htmlThis article is not a simple translation of the original text, is a reference to the original, according to my understanding and practice written. The source code of this article is:Https://github.com/marcelog/erws1 IntroductionErlang can be used to implement a WebSocket server. Cowboy such a framework can accomplish this t
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.