File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ defmodule Bypass do
99
1010 defstruct pid: nil , port: nil
1111
12+ @ typedoc """
13+ Represents a Bypass server process
14+ """
15+ @ type t :: % __MODULE__ { pid: pid , port: non_neg_integer }
16+
1217 import Bypass.Utils
1318 require Logger
1419
@@ -98,9 +103,19 @@ defmodule Bypass do
98103 end
99104 end
100105
106+ @ doc """
107+ Re-opens the TCP socket on the same port.
108+ Blocks until the operation is complete.
109+ """
110+ @ spec up ( Bypass . t ( ) ) :: :ok | { :error , :already_up }
101111 def up ( % Bypass { pid: pid } ) ,
102112 do: Bypass.Instance . call ( pid , :up )
103113
114+ @ doc """
115+ Closes the TCP socket.
116+ Blocks until the operation is complete.
117+ """
118+ @ spec down ( Bypass . t ( ) ) :: :ok | { :error , :already_down }
104119 def down ( % Bypass { pid: pid } ) ,
105120 do: Bypass.Instance . call ( pid , :down )
106121
You can’t perform that action at this time.
0 commit comments