cece Wed Feb 6 09:37:38 2002 EDT
Modified files:
/phpdoc/hu/functions network.xml
Log:
sync with EN revision
Index: phpdoc/hu/functions/network.xml
diff -u phpdoc/hu/functions/network.xml:1.10 phpdoc/hu/functions/network.xml:1.11
--- phpdoc/hu/functions/network.xml:1.10 Sat Feb 2 10:41:26 2002
+++ phpdoc/hu/functions/network.xml Wed Feb 6 09:37:38 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-2"?>
-<!-- EN-Revision: 1.39 Maintainer: cece Status: ready -->
+<!-- EN-Revision: 1.53 Maintainer: cece Status: ready -->
<reference id="ref.network">
<title>H�l�zatkezel�si F�ggv�nyek</title>
@@ -34,10 +34,7 @@
<simpara>
A keresett <parameter>host</parameter> lehet IP c�m �s domainn�v is.
</simpara>
- <simpara>
- A <function>checkdnsrr</function> f�ggv�ny windows
- alatt nem haszn�lhat�.
- </simpara>
+ ¬e.no-windows;
<simpara>
L�sd m�g: <function>getmxrr</function>,
<function>gethostbyaddr</function>,
@@ -200,16 +197,19 @@
<example>
<title><function>fsockopen</function> P�lda</title>
<programlisting role="php">
+<![CDATA[
$fp = fsockopen ("www.php.net", 80, $errno, $errstr, 30);
if (!$fp) {
- echo "$errstr ($errno)<br>\n";
+ echo "$errstr ($errno)<br>\n";
} else {
- fputs ($fp, "GET / HTTP/1.0\r\n\r\n");
+ fputs ($fp, "GET / HTTP/1.0\r\nHost: www.php.net\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
+?>
+]]>
</programlisting>
</example>
A k�vetkez� p�lda bemutatja, hogy gy�jthet� be a saj�t g�p�nk�n lev�
@@ -217,16 +217,18 @@
<example>
<title>UDP kapcsolat haszn�lata</title>
<programlisting role="php">
-<?php
+<![CDATA[
+<?php
$fp = fsockopen("udp://127.0.0.1", 13, $errno, $errstr);
if (!$fp) {
- echo "Hiba: $errno - $errstr<br>\n";
+ echo "Hiba: $errno - $errstr<br>\n";
} else {
fwrite($fp,"\n");
echo fread($fp, 26);
fclose($fp);
}
-?>
+?>
+]]>
</programlisting>
</example>
<note>
@@ -327,7 +329,7 @@
<methodsynopsis>
<type>int</type><methodname>getmxrr</methodname>
<methodparam><type>string</type><parameter>hostn�v</parameter></methodparam>
- <methodparam><type>array</type><parameter>mxhosts</parameter></methodparam>
+ <methodparam><type>t�mb</type><parameter>mxhosts</parameter></methodparam>
<methodparam
choice="opt"><type>array</type><parameter>weight</parameter></methodparam>
</methodsynopsis>
<simpara>
@@ -482,27 +484,38 @@
<example>
<title><function>ip2long</function> P�lda</title>
<programlisting role="php">
-<?php
+<![CDATA[
+<?php
$ip = gethostbyname("www.php.net");
-$out = "Az al�bbi URL-ek egyen�rt�k�ek:<br>\n";
-$out .= "http://hu.php.net/, http://".$ip."/, �s
http://".ip2long($ip)."/<br>\n";
+$out = "Az al�bbi URL-ek egyen�rt�k�ek:<br>\n";
+$out .= "http://hu.php.net/, http://".$ip."/, �s http://".ip2long($ip)."/<br>\n";
echo $out;
-?>
+?>
+]]>
</programlisting>
</example>
- </para>
- <para>
+ <note>
+ <para>
+ Mivel a PHP el�jeles eg�ssz�m �br�zol�st alkalmaz, �s az IP c�mek
+ negat�v sz�mokat eredm�nyezhetnek ez�ltal, sz�ks�ged lehet
+ a <function>sprintf</function> vagy <function>printf</function>
+ f�ggv�ny "%u" form�z� elem�re. Ez�ltal a megjelen�tett sz�m
+ �br�zol�sa el�jel n�lk�li lesz.
+ </para>
+ </note>
Eme m�sodik p�lda pedig azt mutatja meg, hogy a
<function>printf</function> seg�ts�g�vel
hogy tudjuk ez a lekonvert�lt c�met ki�ratni:
<example>
- <title>IP c�m ki�rat�s</title>
+ <title>IP c�m ki�rat�sa</title>
<programlisting role="php">
-<?php
+<![CDATA[
+<?php
$ip = gethostbyname("hu.php.net");
-printf ("%u\n", ip2long ($ip));
+printf ("%u\n", ip2long($ip));
echo $out;
-?>
+?>
+]]>
</programlisting>
</example>
</para>
@@ -762,11 +775,12 @@
</itemizedlist>
<para>
L�sd m�g:
- <function>accept_connect</function>,
- <function>bind</function>,
- <function>connect</function>,
- <function>listen</function> �s
- <function>strerror</function>.
+ <function>socket_accept</function>,
+ <function>socket_bind</function>,
+ <function>socket_connect</function>,
+ <function>socket_listen</function>,
+ <function>socket_strerror</function>, �s a
+ <link linkend="ref.sockets">Socket kieg�sz�t�sek</link>.
</para>
</refsect1>
</refentry>
@@ -824,7 +838,8 @@
<example>
<title><function>socket_set_timeout</function> Example</title>
<programlisting role="php">
-<?php
+<![CDATA[
+<?php
$fp = fsockopen("www.php.net", 80);
if(!$fp) {
echo "Nem siker�lt a webhely megnyit�sa\n";
@@ -837,7 +852,8 @@
fclose($fp);
print $res;
}
-?>
+?>
+]]>
</programlisting>
</example>
</para>
@@ -927,13 +943,14 @@
<example>
<title>A <function>syslog</function> haszn�lata</title>
<programlisting role="php">
-<?php
+<![CDATA[
+<?php
define_syslog_variables();
// syslog nyit�sa, processz azonos�t�st�l. A log
// menjen ki az alap�rtelmezett hibakimenetre is,
// valamint a felhaszn�l� �ltal defini�lt napl�z�
// mechanizmus is kapja meg a logot
-openlog("myScripLog", LOG_PID | LOG_PERROR, LOG_LOCAL0);
+openlog("myScripLog", LOG_PID | LOG_PERROR, LOG_LOCAL0);
// egy kis programk�d
@@ -942,12 +959,13 @@
} else {
// nem azonos�tott felhszn�l�!
// a pr�b�lkoz�s napl�z�sra ker�l
- $access = date("Y/m/d H:i:s");
- syslog(LOG_WARNING,"Unauthorized client: $access $REMOTE_ADDR
($HTTP_USER_AGENT)");
+ $access = date("Y/m/d H:i:s");
+
+ syslog(LOG_WARNING,"Unauthorized client: $access $REMOTE_ADDR
+($HTTP_USER_AGENT)");
}
-
closelog();
-?>
+?>
+]]>
</programlisting>
</example>
Saj�t defini�l�s� syslog kezel� fel�ll�t�s�hoz �rdemes a