From f8f72700e2402e0753124978199ab8801667bfd1 Mon Sep 17 00:00:00 2001 From: Simone Piccardi Date: Wed, 24 Nov 2004 20:49:22 +0000 Subject: [PATCH] Prima bozza per le routine dei socket e file rimasto indietro --- listati/servent.h | 6 ++++++ sources/SockAddr.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 listati/servent.h diff --git a/listati/servent.h b/listati/servent.h new file mode 100644 index 0000000..b810309 --- /dev/null +++ b/listati/servent.h @@ -0,0 +1,6 @@ +struct servent { + char *s_name; /* official service name */ + char **s_aliases; /* alias list */ + int s_port; /* port number */ + char *s_proto; /* protocol to use */ +} diff --git a/sources/SockAddr.c b/sources/SockAddr.c index 9a585eb..9c10fab 100644 --- a/sources/SockAddr.c +++ b/sources/SockAddr.c @@ -62,7 +62,12 @@ */ int tcp_addr(char * address, char * service, struct sockaddr * sa) { - struct addrinfo hints; + struct addrinfo hints = { + ai_flag: AI_CANONNAME, + ai_family: PF_UNSPEC, + ai_socktype: SOCK_STREAM, + ai_protocol: 7 + } /* OK, exit */ -- 2.30.2