The quicer:peername() function is defined as:
@doc Peer name
%% mimic {@link ssl:peername/1}
-spec peername(connection_handle() | stream_handle()) ->
{ok, {inet:ip_address(), inet:port_number()}} | {error, any()}.
peername(Handle) ->
quicer_nif:getopt(Handle, remote_address, false).
So from the spec, it looks like it would work on both connection and stream handles. However, the NIF only handles ATOM_QUIC_PARAM_CONN_REMOTE_ADDRESS in get_connection_opt() and not get_stream_opt(), so currently fails with param_error if the NIF is used on a stream.
Not sure if this is a documentation error or an oversight
The
quicer:peername()function is defined as:So from the spec, it looks like it would work on both connection and stream handles. However, the NIF only handles
ATOM_QUIC_PARAM_CONN_REMOTE_ADDRESSinget_connection_opt()and notget_stream_opt(), so currently fails withparam_errorif the NIF is used on a stream.Not sure if this is a documentation error or an oversight