[Erlang危機](4.4)具名管道,erlang4.4

來源:互聯網
上載者:User

[Erlang危機](4.4)具名管道,erlang4.4
原創文章,轉載請註明出處:伺服器非業餘研究http://blog.csdn.net/erlib 作者Sunface聯絡郵箱:cto@188.com
Named Pipes具名管道(Named Pipes)

A little known way to connect with an Erlang node that requires no explicit distribution is through named pipes. This can be done by starting Erlang with run_erl, which wraps Erlang in a named pipe 5:

 還有一種鮮為人知串連Erlang節點的方法:具名管道(named pipes),可以通過使用run_erl 啟動Erlang來完成 (Erlang會被包裹在具名管道內)5。

-------------------------------------------------------------------------------------
$ run_erl /tmp/erl_pipe /tmp/log_dir "erl"
-------------------------------------------------------------------------------------
The first argument is the name of the file that will act as the named pipe. The second one is where logs will be saved 6.

 第一個參數是指定作為具名管道的檔案,第二個是存放日誌的目錄6。

To connect to the node, you use the to_erl program:

 你可以使用 to_erl程式串連到節點上:

-------------------------------------------------------------------------------------
$ to_erl /tmp/erl_pipe
Attaching to /tmp/erl_pipe (^D to exit)
1>
-------------------------------------------------------------------------------------

And the shell is connected. Closing stdio (with ˆD) will disconnect from the shell while leaving it running.

 串連上後,你可以使用ctrl+D來斷開遠程節點(只是斷開,不會終結遠程節點).

[5] "erl" is the command being run. Additional arguments can be added after it. For example "erl +K true" will turn kernel polling on.
[6] Using this method ends up calling fsync for each piece of output, which may give quite a performance hit if a lot of IO is taking place over standard output.

[注5]:“erl”就是要啟動並執行命令,你也可以在後面加上其它啟動選項如"erl +K ture"會把開啟核心kernel輪詢。
[注6] :這個方法最終會調用fsync會同步每一塊輸出,如果有大量的IO操作產生,效能會下降得很厲害。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.