forked from erlang/otp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
the type specs for socker.erl were improved in PR-8986, but they introduced a bug by omitting one of the overloaded specs. this commit fixes that, and adds a test to check for it
- Loading branch information
1 parent
5674bfc
commit b8599b0
Showing
3 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-module(sock). | ||
|
||
-export([sendto/4]). | ||
|
||
family({_,_,_,_}) -> inet; | ||
family({_,_,_,_,_,_,_,_}) -> inet6. | ||
|
||
sendto(Socket, IP, Port, Data) -> | ||
Dest = #{family => family(IP), | ||
addr => IP, | ||
port => Port}, | ||
case socket:sendto(Socket, Data, Dest, nowait) of | ||
ok -> ok; | ||
Other -> | ||
logger:debug("sendto(~p) failed with: ~p", [Dest, Other]), | ||
ok | ||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters