TCP echo server

This commit is contained in:
Alexander Heldt
2025-11-11 20:36:55 +01:00
parent 28b29d3dbf
commit a1971693ef
8 changed files with 191 additions and 50 deletions

View File

@@ -1,8 +1,14 @@
-module(tcp_ffi).
-export([send/2]).
-export([send/2, shutdown/2]).
send(Socket, Packet) ->
case gen_tcp:send(Socket, Packet) of
ok -> {ok, nil};
Res -> Res
end.
shutdown(Socket, How) ->
case gen_tcp:shutdown(Socket, How) of
ok -> {ok, nil};
Res -> Res
end.