`
coderplay
  • 浏览: 571399 次
  • 性别: Icon_minigender_1
  • 来自: 广州杭州
社区版块
存档分类
最新评论
文章列表
6 Sys and Proc_Lib The module sys contains functions for simple debugging of processes implemented using behaviours. There are also functions that, together with functions in the module proc_lib, can be used to implement a special process, a process which comply to the OTP design principles without ...
前些天给echo_server写了个非常简单的连接压力测试程序, 代码   -module(stress_test).      -export([start/0, tests/1]).      start() ->       tests(12345).      tests(Port) ->       io:format("starting~n&qu ...
erlc 命令 erlc 概要 编译器 描述 The erlc program provides a common way to run all compilers in the Erlang system. Depending on the extension of each input file, erlc will invoke the appropriate compiler. Regardless of which compiler is used, the same flags are used to provide parameters such as include ...
1. ssh     这东西连起来真麻烦, 比如有三台机器有10,20,30     要建ssh的有: 10->20,20->10, 10->30,30->10, 20->30, 30->20     最少要建连接数是一个排列数A(n, 2), 其中n代表节点数, 2代表任选两个节点. 3个节点得有A(3, 2) = 6. 2. 如果是用root用户, 则mpd.conf文件放在/etc下面,而不是.mpd.conf.其它用户是.mpd.conf 3. mpdboot根据一个文件来启动,一般用mpd.hosts. 得定义local节点在哪, 其它节点则在远程 ...
代码   -module(echo_server).   -export([start/0,stop/0]).      -define(LISTEN_PORT,12345).     % 开放端口   -define(MAX_CONN, 5000).        % 最大连接数      start() ->       process_flag(trap_exit, true), % 设置退出陷阱       tcp_server:start_raw_server(?LISTEN_PORT,     ...
原译文发布在ocaml.cn , 这里的blog不支持html的说,郁闷 Ocamllex 改编者: SooHyoung Oh  此指南讲解怎么使用Ocaml语言分发包所带的ocamllex. 此文档从 flex 手册借签了很多. 请把你的意见和建议发至 此指南还在编写当中,最新的版本放在 http ...
5 Supervisor Behaviour This section should be read in conjunction with supervisor(3), where all details about the supervisor behaviour is given. 这节应该和supervisor(3)结合来读,所有关于supervisor行为的细节都在那儿。 5.1 Supervision Principles A supervisor is responsible for starting, stopping and monitoring its child pro ...
4 Gen_Event 行为 这一章应该与gen_event(3)结合起来看,gen_event(3)对所有接口函数和回调函数都有详细描述.  4.1 事件处理原则 在OTP中, an event manager is a named object to which events can be sent. An event could be, for example, an error, an alarm or some information that should be logged. In the event manager, zero, one or several event ...
3 Gen_Fsm 行为 This chapter should be read in conjunction with gen_fsm(3), where all interface functions and callback functions are described in detail. 3.1 Finite State Machines 3.1 有限状态机 A finite state machine, FSM, can be described as a set of relations of the form: java 代码State(S) x Event(E) -> ...
2 Gen_Server Behaviour This chapter should be read in conjunction with gen_server(3), where all interface functions and callback functions are described in detail. 2.1 Client-Server Principles The client-server model is characterized by a central server and an arbitrary number of clients. The clien ...
1 Overview OTP 设计原则 是一套教你如何运用进程,模块和目录等条件来组织Erlang代码的原则. 1.1 Supervision Trees 管理树 A basic concept in Erlang/OTP is the supervision tree. This is a process structuring model based on the idea of workers and supervisors. Erlang/OTP中的一个基本概念就是 管理树. 这是一个以工作者和管理者思想为基础的进程结构模型. Workers are process ...

whereis函数

whereis(RegName) -> pid() | port() | undefined Returns the pid or port identifier with the registered name RegName. Returns undefined if the name is not registered. 原来是erlang核心模块的东东, erlang:whereis/1.  传入注册的名称RegName, 返回进程ID或端口ID.如果没注册的话,返回undefined.
java 代码   %% Copyright (C) 2002, Joe Armstrong   %% File    : tcp_server.erl   %% Author  : Joe Armstrong (joe@sics.se)   %% Purpose : Keeps track of a number of TCP sessions   %% Last modified: 2002-11-17      -module(tcp_server).      -export([start_raw_server/ ...
Global site tag (gtag.js) - Google Analytics