Skip to content

Vladi2017/Erlang_1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Erlang_1

A tcpServer (wrote in Erlang) controlled by an Android client.

This server works with menu item 10.TCPclient1 in my repo Android_1. It is implemented based on generic server gen_server OTP standard behavior. After the client is connected, the server sends periodically keepAlive to the Android client to keep up the socket channel over (p)MNO ((public) mobile network operator) air interface. Basically the client responds with his status. Also keepAliveInterval can be controlled at run time from the Android client based on a minimal message protocol. Both TCPserver and TCPclient produce detailed logs.

Usage:

  1. Install Erlang/OTP
  2. clone this repo.
  • Then in Erlang shell:

    2> cd("path_to_TCPserver").

  1. To compile:

    3> c(echo_server,[verbose,no_load]).

    4> c(socket_server,[verbose,no_load]).

  2. Check there was generated the two .beam files:

    5> ls().

  3. Start tcpServer:

    6> echo_server:start(listen_port).

  4. Launch TCPclient1 on the Android phone, set server IP address and port, select Connect.

Tip: For long term running (e.g. on a RaspberryPi (RPI)) you can run the Erlang shell in screen window manager (please see screen home page for details). This way the tcpServer can run as a background process keeping available the login shell..

About

A tcpServer (wrote in Erlang) controlled by an Android client.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages