summaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/dlt_daemon_socket.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/daemon/dlt_daemon_socket.c b/src/daemon/dlt_daemon_socket.c
index 1492831..12f16a8 100644
--- a/src/daemon/dlt_daemon_socket.c
+++ b/src/daemon/dlt_daemon_socket.c
@@ -82,16 +82,21 @@ static char str[DLT_DAEMON_TEXTBUFSIZE];
int dlt_daemon_socket_open(int *sock)
{
int yes = 1;
-
+ int socket_family = PF_INET;
+ int socket_type = SOCK_STREAM;
+ int protocol = IPPROTO_TCP;
struct sockaddr_in servAddr;
unsigned int servPort = DLT_DAEMON_TCP_PORT;
- if ((*sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+ if ((*sock = socket(socket_family, socket_type, protocol)) < 0)
{
dlt_log(LOG_ERR, "dlt_daemon_socket_open: socket() failed!\n");
return -1;
} /* if */
+ sprintf(str,"%s: Socket created - socket_family:%i, socket_type:%i, protocol:%i\n", __FUNCTION__, socket_family, socket_type, protocol);
+ dlt_log(LOG_INFO, str);
+
if ( -1 == setsockopt(*sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)))
{
sprintf(str,"dlt_daemon_socket_open: Setsockopt error in dlt_daemon_local_connection_init: %s\n",strerror(errno));
@@ -115,6 +120,9 @@ int dlt_daemon_socket_open(int *sock)
return -1;
} /* if */
+ sprintf(str,"%s: Listening on port: %u\n",__FUNCTION__,servPort);
+ dlt_log(LOG_INFO, str);
+
/* get socket buffer size */
sprintf(str,"dlt_daemon_socket_open: Socket send queue size: %d\n",dlt_daemon_socket_get_send_qeue_max_size(*sock));
dlt_log(LOG_INFO, str);