aboutsummaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 54e1bd6a..409e4f66 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -775,22 +775,8 @@ nni_sock_closeall(void)
static void
nni_sock_normalize_expiration(nni_aio *aio, nni_duration def)
{
- if (aio->a_reltime) {
- if (aio->a_expire == (nni_time) -2) {
- aio->a_expire = def;
- }
- switch (aio->a_expire) {
- case (nni_time) 0:
- aio->a_expire = NNI_TIME_ZERO;
- break;
- case (nni_time) -1:
- aio->a_expire = NNI_TIME_NEVER;
- break;
- default:
- aio->a_expire = nni_clock() + aio->a_expire;
- break;
- }
- aio->a_reltime = 0;
+ if (aio->a_timeout == (nni_duration) -2) {
+ aio->a_timeout = def;
}
}
@@ -821,6 +807,18 @@ nni_sock_peer(nni_sock *sock)
return (sock->s_peer_id.p_id);
}
+const char *
+nni_sock_proto_name(nni_sock *sock)
+{
+ return (sock->s_self_id.p_name);
+}
+
+const char *
+nni_sock_peer_name(nni_sock *sock)
+{
+ return (sock->s_peer_id.p_name);
+}
+
void
nni_sock_reconntimes(nni_sock *sock, nni_duration *rcur, nni_duration *rmax)
{