diff options
author | Stig Venaas <venaas@php.net> | 2000-09-03 19:12:28 +0000 |
---|---|---|
committer | Stig Venaas <venaas@php.net> | 2000-09-03 19:12:28 +0000 |
commit | f0962c33a1a63f17f336baa7c3aad13d6bfbc2a4 (patch) | |
tree | aa2b4a5aa7cf187a7364ec4fe906cd851c0b7c7c | |
parent | 1109b9ab575708168edd4fedeb10731a52e4e968 (diff) | |
download | php-git-f0962c33a1a63f17f336baa7c3aad13d6bfbc2a4.tar.gz |
Added timeout argument, but not used yet
-rw-r--r-- | main/network.c | 7 | ||||
-rw-r--r-- | main/php_network.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/main/network.c b/main/network.c index ca33b8e8f6..84a3277114 100644 --- a/main/network.c +++ b/main/network.c @@ -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) diff --git a/main/php_network.h b/main/php_network.h index c7abb676a3..ae605e0b66 100644 --- a/main/php_network.h +++ b/main/php_network.h @@ -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: |