Skip to content
josemic edited this page Dec 29, 2012 · 9 revisions

On Linux:

Install Erlang/OTP.

  • e.g. apt-get install erlang Maybe other erlang packages need be installed too.

On Windows:

Download the Erlang-command-line-interface git clone git://github.com/josemic/Erlang-command-line-interface_otp.git

Run within the directory "Erlang-command-line-interface_otp":

  • `mkdir ./appl1/ebin
  • `mkdir ./appl2/ebin
  • `mkdir ./tcp_connection/ebin
  • erlc -o ./appl1/ebin/ ./appl1/src/*.erl
  • erlc -o ./tcp_connection/ebin/ ./tcp_connection/src/*.erl

All sources will be compiled and the telnet server will be started on Port 1025. Run Erlang within the directory "Erlang-command-line-interface":

  • erl -pa ./tcp_connection/ebin/ -pa ./appl1/ebin/ -pa ./appl2/ebin/

On Erlang command line: If you want to see debug output (optional):

  • application:start(sasl).
    If you want to change the default port, which is 1025, e.g. to port 1026
  • application:set_env(tcp_server, port, 1026).
    If you want to change the name prefix of the default configuration file, which is "Configuration". The file loaded depends on the n name of the application e.g. appl1. <prefix>_<application_nameS>
    If the prefix is "ConfigurationUnix" and the started application is "appl1" then the name of the load configuration file is "ConfigurationUnix_appl1.txt"
    If you want to change the prefix of the application (recommended, make sure the configuration file is available):
  • application:set_env(tcp_server, conf_file, "ConfigurationUnix").

Now start the tcp_server:

  • application:start(tcp_server).

Start the application monitor to see the OTP processes and
click on the icon 'tcp_server'(optional):

  • appmon:start().

Now start the application and load the configuration file "ConfigurationUnix_appl1.txt":

  • appl1:start().

Run one or more telnet terminals on the port defined above:

  • telnet localhost 1026

Note: As short cut for the steps above had been defined:

  • s:s().
Clone this wiki locally