]> granicus.if.org Git - php/commitdiff
Added timeout argument, but not used yet
authorStig Venaas <venaas@php.net>
Sun, 3 Sep 2000 19:12:28 +0000 (19:12 +0000)
committerStig Venaas <venaas@php.net>
Sun, 3 Sep 2000 19:12:28 +0000 (19:12 +0000)
main/network.c
main/php_network.h

index ca33b8e8f6d73b89837e35e1931f27575c8cb5df..84a3277114e75350803827fe773eab21218712e5 100644 (file)
@@ -58,7 +58,7 @@
 /*
  * Converts a host name to an IP address.
  */
-static int my_lookup_hostname(const char *addr, struct in_addr *in)
+static int php_network_lookup_hostname(const char *addr, struct in_addr *in)
 {
         struct hostent *host_info;
 
@@ -77,13 +77,14 @@ static int my_lookup_hostname(const char *addr, struct in_addr *in)
 /*
  * Creates a socket of type socktype and connects to the given host and
  * port, returns the created socket on success, else returns -1.
+ * timeout gives timeout in seconds, 0 means blocking mode.
  */
-int hostconnect(char *host, int port, int socktype)
+int hostconnect(char *host, int port, int socktype, int timeout)
 {      
        int s;
        struct sockaddr_in sa;
 
-       if (my_lookup_hostname(host, &sa.sin_addr))
+       if (php_network_lookup_hostname(host, &sa.sin_addr))
                return -1;
        s = socket(PF_INET, socktype, 0);
        if (s == SOCK_ERR)
index c7abb676a36ebc49b78770f399862b2448aaedc6..ae605e0b66af6d466910e54accc60de9fef4eee0 100644 (file)
@@ -17,7 +17,7 @@
  */
 /* $Id$ */
 
-int hostconnect(char *host, int port, int socktype);
+int hostconnect(char *host, int port, int socktype, int timeout);
 
 /*
  * Local variables: