ŹR
Size: a a a
ŹR
ŹR
D
ŹR
ŹR
ŹR
ŹR
D
D
D
D
ŹR
ŹR
D
ŹR
D
ŹR
ŹR
@doc """
Sends a frame through the WebSocket.
If the connection is either connecting or closing then this will return an
error tuple with a `WebSockex.NotConnectedError` exception struct as the
second element.
If a connection failure is discovered while sending then it will return an
error tuple with a `WebSockex.ConnError` exception struct as the second
element.
"""
@spec send_frame(client, frame) ::
:ok
| {:error,
%WebSockex.FrameEncodeError{}
| %WebSockex.ConnError{}
| %WebSockex.NotConnectedError{}
| %WebSockex.InvalidFrameError{}}
| none
def send_frame(client, _) when client == self() do
raise %WebSockex.CallingSelfError{function: :send_frame}
end
def send_frame(client, frame) do
try do
{:ok, res} = :gen.call(client, :"$websockex_send", frame)
res
catch
_, reason ->
exit({reason, {__MODULE__, :call, [client, frame]}})
end
end
ŹR
D
exit({reason, {__MODULE__, :call, [client, frame]}})