/*
* $Id$
* $Log$
+ * Revision 1.2 2000/10/31 19:48:32 priikone
+ * A LOT updates. Cannot separate. :)
+ *
* Revision 1.1 2000/09/13 17:45:16 priikone
* Splitted SILC core library. Core library includes now only
* SILC protocol specific stuff. New utility library includes the
return -1;
}
- /* Set appropriate option */
+ /* Set appropriate options */
silc_net_set_socket_opt(sock, IPPROTO_TCP, TCP_NODELAY, 1);
+ silc_net_set_socket_opt(sock, SOL_SOCKET, SO_KEEPALIVE, 1);
SILC_LOG_DEBUG(("Connection created"));
}
}
- /* Set appropriate option */
+ /* Set appropriate options */
silc_net_set_socket_opt(sock, IPPROTO_TCP, TCP_NODELAY, 1);
+ silc_net_set_socket_opt(sock, SOL_SOCKET, SO_KEEPALIVE, 1);
SILC_LOG_DEBUG(("Connection operation in progress"));
memcpy(*ip, host_ip, strlen(host_ip));
SILC_LOG_DEBUG(("Resolved IP address `%s'", *ip));
}
+
+/* Return name of localhost. */
+
+char *silc_net_localhost()
+{
+ char hostname[256];
+ if (!gethostname(hostname, sizeof(hostname)))
+ return strdup(hostname);
+ return NULL;
+}