Skip to content

Instantly share code, notes, and snippets.

View gilons's full-sized avatar
🏠
Working from home

Mr Break; gilons

🏠
Working from home
View GitHub Profile
-module(socket).
-export([start/0, start_socket/1]).
start() -> spawn_link(?MODULE, start_socket, [self()]).
start_socket(Pid) ->
{ok, ListenSocket} = gen_tcp:listen(3555,
[{active, true}, {reuseaddr, true}]),
connection(ListenSocket, Pid).
-module(tcp).
-export([connect/1, handle_connection/0,
handle_system_msg/6, init/1, listen/0, loop/2,
start_link/0, system_continue/3, system_replace_state/2,
system_terminate/4, write_debug/3]).
-include("./rec.hrl").
-define(LOG_ERROR, "~p Crashed Deu to: ~p").