emqtt_sock (emqtt v1.15.1)
View SourceSummary
Types
-type option() :: gen_tcp:connect_option() | {ssl_opts, [ssl:tls_client_option()]}.
-type socket() :: inet:socket() | #ssl_socket{tcp :: term(), ssl :: term()}.
-type sockname() :: {inet:ip_address(), inet:port_number()}.
Functions
-spec close(socket()) -> ok.
-spec connect(inet:ip_address() | inet:hostname(), inet:port_number(), [option()], timeout()) -> {ok, socket()} | {error, term()}.
-spec recv(socket(), non_neg_integer()) -> {ok, iodata()} | {error, closed | inet:posix()}.
-spec setopts(socket(), [gen_tcp:option() | ssl:tls_client_option()]) -> ok | {error, any()}.