diff options
author | Hans Bolinder <[email protected]> | 2011-05-13 13:55:22 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2011-05-13 13:55:22 +0200 |
commit | 897c1066e6c06285b1854b5af5c70dba0fd4f0ed (patch) | |
tree | 38f0daa552efff686ae57871873fbb148a5e9399 /lib/kernel/src/inet_udp.erl | |
parent | b1e768e86593178810c8a0b3c38443dcf6be5181 (diff) | |
parent | bd5e9c5746eb02666e8c6ae7af3f4dff514e3677 (diff) | |
download | otp-897c1066e6c06285b1854b5af5c70dba0fd4f0ed.tar.gz otp-897c1066e6c06285b1854b5af5c70dba0fd4f0ed.tar.bz2 otp-897c1066e6c06285b1854b5af5c70dba0fd4f0ed.zip |
Merge branch 'hb/kernel/specs/OTP-9268' into dev
* hb/kernel/specs/OTP-9268:
Types and specifications have been modified and added
Diffstat (limited to 'lib/kernel/src/inet_udp.erl')
-rw-r--r-- | lib/kernel/src/inet_udp.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/kernel/src/inet_udp.erl b/lib/kernel/src/inet_udp.erl index 9a4089ab19..60bd96f332 100644 --- a/lib/kernel/src/inet_udp.erl +++ b/lib/kernel/src/inet_udp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -39,8 +39,10 @@ getserv(Name) when is_atom(Name) -> inet:getservbyname(Name,udp). getaddr(Address) -> inet:getaddr(Address, inet). getaddr(Address,Timer) -> inet:getaddr_tm(Address, inet, Timer). +-spec open(_) -> {ok, inet:socket()} | {error, atom()}. open(Port) -> open(Port, []). +-spec open(_, _) -> {ok, inet:socket()} | {error, atom()}. open(Port, Opts) -> case inet:udp_options( [{port,Port}, {recbuf, ?RECBUF} | Opts], @@ -69,6 +71,8 @@ recv(S,Len) -> recv(S,Len,Time) -> prim_inet:recvfrom(S, Len, Time). +-spec close(inet:socket()) -> ok. + close(S) -> inet:udp_close(S). |