diff options
author | Essien Ita Essien <essiene@gmail.com> | 2009-01-16 09:18:25 +0100 |
---|---|---|
committer | Essien Ita Essien <essiene@gmail.com> | 2009-01-16 09:18:25 +0100 |
commit | ce98bd2ac8d63f393702b944889f25a4ce726391 (patch) | |
tree | 905f7f8e6fdff3b7e326688a79c34e41e1866d88 /src/rabbit_net.erl | |
parent | 603810ea9cffff9687d57c0c4b5cc69168a81cb8 (diff) | |
download | rabbitmq-server-ce98bd2ac8d63f393702b944889f25a4ce726391.tar.gz |
Actually run 'make dialyze'! and fix some type definitions.
Redefine timeout() to also take -1.
Define a type error() for {'error', any()}. Less code
There is still a problem with rabbit_net:send/2 type definition
using iolist().
Diffstat (limited to 'src/rabbit_net.erl')
-rw-r--r-- | src/rabbit_net.erl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/rabbit_net.erl b/src/rabbit_net.erl index 871cd976..2f0b9ce0 100644 --- a/src/rabbit_net.erl +++ b/src/rabbit_net.erl @@ -43,19 +43,20 @@ -type(stat_option() :: 'recv_cnt' | 'recv_max' | 'recv_avg' | 'recv_oct' | 'recv_dvi' | 'send_cnt' | 'send_max' | 'send_avg' | 'send_oct' | 'send_pend'). --type(timeout() :: 'infinity' | non_neg_integer()). +-type(timeout() :: 'infinity' | -1 | non_neg_integer()). +-type(error() :: {'error', any()}). -spec(async_recv/3 :: (socket(), integer(), timeout()) -> {'ok', ref()}). --spec(close/1 :: (socket()) -> 'ok' | {'error', any()}). --spec(controlling_process/2 :: (socket(), pid()) -> 'ok' | {'error', any()}). +-spec(close/1 :: (socket()) -> 'ok' | error()). +-spec(controlling_process/2 :: (socket(), pid()) -> 'ok' | error()). -spec(port_command/2 :: (socket(), iolist()) -> 'true'). --spec(send/2 :: (socket(), iolist()) -> 'ok' | {'error', any()}). +-spec(send/2 :: (socket(), iolist()) -> 'ok' | error()). -spec(peername/1 :: (socket()) -> - {'ok', {ip_address(), non_neg_integer()}} | {'error', any()}). + {'ok', {ip_address(), non_neg_integer()}} | error()). -spec(sockname/1 :: (socket()) -> - {'ok', {ip_address(), non_neg_integer()}} | {'error', any()}). + {'ok', {ip_address(), non_neg_integer()}} | error()). -spec(getstat/2 :: (socket(), [stat_option()]) -> - {'ok', [{stat_option(), integer()}]} | {'error', any()}). + {'ok', [{stat_option(), integer()}]} | error()). -endif. |