From 9a4f6de16e50013a56b1fcedd8f1ba9f179497a1 Mon Sep 17 00:00:00 2001 From: Egon Schmid Date: Tue, 28 Mar 2000 23:33:28 +0000 Subject: [PATCH] It should be now readable. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@22073 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/network.xml | 387 +++++++++++++++++++++++------------------- 1 file changed, 215 insertions(+), 172 deletions(-) diff --git a/functions/network.xml b/functions/network.xml index fa098955e8..b8972419b1 100644 --- a/functions/network.xml +++ b/functions/network.xml @@ -1,50 +1,52 @@ - Network functions + Network Functions Network checkdnsrr - Check DNS records corresponding to a given - Internet host name or IP address. + + Check DNS records corresponding to a given Internet host name or + IP address + Description int checkdnsrr string host - string type + string + type + - Searches DNS for records of type type corresponding to host. Returns true if any records are found; returns false if no records were found or if - an error occurred. - + an error occurred. + type may be any one of: A, MX, NS, SOA, - PTR, CNAME, or ANY. The default is MX. - + PTR, CNAME, or ANY. The default is MX. + - host may either be the IP address in - dotted-quad notation or the host name. - + Host may either be the IP address in + dotted-quad notation or the host name. + - See also - getmxrr, - gethostbyaddr, - gethostbyname, - gethostbynamel, and - the named(8) manual page. - + See also getmxrr, + gethostbyaddr, + gethostbyname, + gethostbynamel, and the named(8) manual + page. + closelog - close connection to system logger + Close connection to system logger Description @@ -53,16 +55,17 @@ - closelog closes the descriptor being used to + Closelog closes the descriptor being used to write to the system logger. The use of - closelog is optional. + closelog is optional. + debugger_off - disable internal PHP debugger + Disable internal PHP debugger Description @@ -72,14 +75,15 @@ Disables the internal PHP debugger. The debugger is still under - development. + development. + debugger_on - enable internal PHP debugger + Enable internal PHP debugger Description @@ -90,14 +94,17 @@ Enables the internal PHP debugger, connecting it to address. The debugger is still under - development. + development. + fsockopen - Open Internet or Unix domain socket connection. + + Open Internet or Unix domain socket connection + Description @@ -105,71 +112,80 @@ int fsockopen string hostname int port - int errno - string errstr + int + errno + + string + errstr + double - timeout + timeout + - - Initiates a stream connection in the Internet (AF_INET) or Unix (AF_UNIX) - domain. For the Internet domain, it will open a TCP socket connection to - hostname on port port. For - the Unix domain, hostname will be used as the path - to the socket, port must be set to 0 in this case. - The optional timeout can be used to set a timeout - in seconds for the connect system call. - + Initiates a stream connection in the Internet (AF_INET) or Unix + (AF_UNIX) domain. For the Internet domain, it will open a TCP + socket connection to hostname on port + port. For the Unix domain, + hostname will be used as the path to the + socket, port must be set to 0 in this + case. The optional timeout can be used to + set a timeout in seconds for the connect system call. + - fsockopen returns a file pointer which may be used - together with the other file functions (such as + Fsockopen returns a file pointer which may + be used together with the other file functions (such as fgets, fgetss, - fputs, fclose, - feof). - + fputs, fclose, and + feof). + If the call fails, it will return false and if the optional - errno and errstr arguments - are present they will be set to indicate the actual system level error - that occurred on the system-level connect() call. If the returned errno is - 0 and the function returned false, it is an indication that the error - occurred before the connect() call. This is most likely due to a problem - initializing the socket. Note that the errno and errstr arguments must be - passed by reference. - + errno and errstr + arguments are present they will be set to indicate the actual + system level error that occurred on the system-level + connect() call. If the returned errno is 0 and + the function returned false, it is an indication that the error + occurred before the connect() call. This is + most likely due to a problem initializing the socket. Note that + the errno and + errstr arguments must be passed by + reference. + - Depending on the environment, the Unix domain or the optional connect - timeout may not be available. - - - The socket will by default be opened in blocking mode. You can switch it - to non-blocking mode by using set_socket_blocking. - - fsockopen example - -$fp = fsockopen("www.php.net", 80, &$errno, &$errstr, 30); -if(!$fp) { - echo "$errstr ($errno)<br>\n"; + Depending on the environment, the Unix domain or the optional + connect timeout may not be available. + + + The socket will by default be opened in blocking mode. You can + switch it to non-blocking mode by using + Set_socket_blocking. + + <function>Fsockopen</function> Example + +$fp = fsockopen ("www.php.net", 80, &$errno, &$errstr, 30); +if (!$fp) { + echo "$errstr ($errno)<br>\n"; } else { - fputs($fp,"GET / HTTP/1.0\n\n"); - while(!feof($fp)) { - echo fgets($fp,128); - } - fclose($fp); + fputs ($fp, "GET / HTTP/1.0\n\n"); + while (!feof($fp)) { + echo fgets ($fp,128); + } + fclose ($fp); } - - - - See also: pfsockopen - + + + See also: pfsockopen + - + gethostbyaddr - Get the Internet host name corresponding to a given - IP address. + + Get the Internet host name corresponding to a given IP address + Description @@ -177,23 +193,23 @@ if(!$fp) { string gethostbyaddr string ip_address - Returns the host name of the Internet host specified by ip_address. If an error occurs, returns - ip_address. - - - See also gethostbyname. - + ip_address. + + + See also gethostbyname. + gethostbyname - Get the IP address corresponding to a given - Internet host name. + + Get the IP address corresponding to a given Internet host name + Description @@ -201,22 +217,23 @@ if(!$fp) { string gethostbyname string hostname - Returns the IP address of the Internet host specified by - hostname. - - - See also gethostbyaddr. - + hostname. + + + See also gethostbyaddr. + gethostbynamel - Get a list of IP addresses corresponding to a given - Internet host name. + + Get a list of IP addresses corresponding to a given Internet host + name + Description @@ -224,27 +241,25 @@ if(!$fp) { array gethostbynamel string hostname - Returns a list of IP addresses to which the Internet host - specified by hostname resolves. - + specified by hostname resolves. + - See also - gethostbyname, - gethostbyaddr, - checkdnsrr, - getmxrr, and - the named(8) manual page. - + See also gethostbyname, + gethostbyaddr, + checkdnsrr, getmxrr, + and the named(8) manual page. + getmxrr - Get MX records corresponding to a given - Internet host name. + + Get MX records corresponding to a given Internet host name + Description @@ -252,35 +267,38 @@ if(!$fp) { int getmxrr string hostname array mxhosts - array weight + array + weight + - Searches DNS for MX records corresponding to hostname. Returns true if any records are - found; returns false if no records were found or if an error occurred. - + found; returns false if no records were found or if an error + occurred. + A list of the MX records found is placed into the array mxhosts. If the weight array is given, it will be filled - with the weight information gathered. - + with the weight information gathered. + - See also - checkdnsrr, + See also checkdnsrr, gethostbyname, gethostbynamel, - gethostbyaddr, and - the named(8) manual page. - + gethostbyaddr, and the + named(8) manual page. + getprotobyname - get protocol number associated with protocol name + + Get protocol number associated with protocol name + Description @@ -288,20 +306,23 @@ if(!$fp) { int getprotobyname string name - - getprotobyname returns the protocol number + Getprotobyname returns the protocol number associated with the protocol name as per /etc/protocols. - - See also getprotobynumber. + + + See also: getprotobynumber. + getprotobynumber - get protocol name associated with protocol number + + Get protocol name associated with protocol number + Description @@ -309,20 +330,23 @@ if(!$fp) { string getprotobynumber int number - - getprotobynumber returns the protocol name + Getprotobynumber returns the protocol name associated with protocol number as per /etc/protocols. - - See also getprotobyname. + + + See also: getprotobyname. + getservbyname - get port number associated with an Internet service and protocol + + Get port number associated with an Internet service and protocol + Description @@ -331,22 +355,26 @@ if(!$fp) { string service string protocol - - getservbyname returns the Internet port which - corresponds to service for the specified - protocol as per /etc/services. - protocol is either tcp or - udp. - - See also getservbyport. + Getservbyname returns the Internet port + which corresponds to service for the + specified protocol as per + /etc/services. + protocol is either TCP + or UDP. + + + See also: getservbyport. + getservbyport - get Internet service which corresponds to port and protocol + + Get Internet service which corresponds to port and protocol + Description @@ -355,22 +383,23 @@ if(!$fp) { int port string protocol - - getservbyport returns the Internet service - associated with port for the specified - protocol as per /etc/services. - protocol is either tcp or - udp. - - See also getservbyname. + Getservbyport returns the Internet service + associated with port for the specified + protocol as per /etc/services. + protocol is either TCP + or UDP. + + + See also: getservbyname. + openlog - open connection to system logger + Open connection to system logger Description @@ -380,25 +409,29 @@ if(!$fp) { int option int facility - - openlog opens a connection to the system + Openlog opens a connection to the system logger for a program. The string ident is added to each message. Values for option and facility are given in the next - section. The use of openlog() is optional; It will automatically - be called by syslog if necessary, in which - case ident will default to false. - + section. The use of openlog is optional; It + will automatically be called by syslog if + necessary, in which case ident will default + to false. + + See also syslog and - closelog. + closelog. + pfsockopen - Open persistent Internet or Unix domain socket connection. + + Open persistent Internet or Unix domain socket connection + Description @@ -406,16 +439,22 @@ if(!$fp) { int pfsockopen string hostname int port - int errno - string errstr + int + errno + + string + errstr + int - timeout + timeout + - - This function behaves exactly as fsockopen with the - difference that the connection is not closed after the script finishes. - It is the persistent version of fsockopen. + This function behaves exactly as fsockopen + with the difference that the connection is not closed after the + script finishes. It is the persistent version of + fsockopen. + @@ -436,17 +475,17 @@ if(!$fp) { descriptor will be switched to non-blocking mode, and if true, it will be switched to blocking mode. This affects calls like fgets that read from the socket. In - non-blocking mode an fgets() call will always return right away - while in blocking mode it will wait for data to become available - on the socket. - + non-blocking mode an fgets call will always + return right away while in blocking mode it will wait for data to + become available on the socket. + syslog - generate a system log message + Generate a system log message Description @@ -456,24 +495,28 @@ if(!$fp) { string message - syslog generates a log message that will be + Syslog generates a log message that will be distributed by the system logger. priority is a combination of the facility and the level, values for which are given in the next section. The remaining argument is the message to send, except that the two characters %m will be replaced by the error message string (strerror) corresponding to the present - value of errno. + value of errno. + - More information on the syslog facilities can be found in - the man pages for syslog on Unix machines. + More information on the syslog facilities can be found in the man + pages for syslog on Unix machines. + - On Windows NT, the syslog service is emulated using the - Event Log. + On Windows NT, the syslog service is emulated using the Event + Log. + +