diff options
Diffstat (limited to 'portman.erl')
-rw-r--r-- | portman.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/portman.erl b/portman.erl index 393a566..3076a39 100644 --- a/portman.erl +++ b/portman.erl @@ -10,11 +10,14 @@ -author("Tuowen"). %% API --export([start/1,serv/1,send/2]). +-export([start/1,serv/1]). oploop(Sock) -> receive {Pid,shutdown} -> ok; + {tcp,Sock,Msg} -> + io:format("~p\n",[Msg]), + oploop(Sock); {Pid,Msg} -> gen_tcp:send(Sock,Msg), oploop(Sock) @@ -27,7 +30,4 @@ serv({Host,Port}) -> ok = gen_tcp:close(Sock). start(Config) -> - spawn(?MODULE,serv,[Config]). - -send(Pid,Msg) -> - Pid ! {self(),Msg}.
\ No newline at end of file + spawn(?MODULE,serv,[Config]).
\ No newline at end of file |