source: www/manuals/PHP_manual/function.socket-getpeername.html@ 1

Last change on this file since 1 was 1, checked in by george, 17 years ago

Prvotní import všeho

File size: 4.4 KB
Line 
1<HTML
2><HEAD
3><TITLE
4>socket_getpeername</TITLE
5><META
6NAME="GENERATOR"
7CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
8REL="HOME"
9TITLE="Manuál PHP"
10HREF="index.html"><LINK
11REL="UP"
12TITLE="Socket functions"
13HREF="ref.sockets.html"><LINK
14REL="PREVIOUS"
15TITLE="socket_get_option"
16HREF="function.socket-get-option.html"><LINK
17REL="NEXT"
18TITLE="socket_getsockname"
19HREF="function.socket-getsockname.html"><META
20HTTP-EQUIV="Content-type"
21CONTENT="text/html; charset=ISO-8859-2"></HEAD
22><BODY
23CLASS="refentry"
24BGCOLOR="#FFFFFF"
25TEXT="#000000"
26LINK="#0000FF"
27VLINK="#840084"
28ALINK="#0000FF"
29><DIV
30CLASS="NAVHEADER"
31><TABLE
32SUMMARY="Header navigation table"
33WIDTH="100%"
34BORDER="0"
35CELLPADDING="0"
36CELLSPACING="0"
37><TR
38><TH
39COLSPAN="3"
40ALIGN="center"
41>Manuál PHP</TH
42></TR
43><TR
44><TD
45WIDTH="10%"
46ALIGN="left"
47VALIGN="bottom"
48><A
49HREF="function.socket-get-option.html"
50ACCESSKEY="P"
51>Pøedcházející</A
52></TD
53><TD
54WIDTH="80%"
55ALIGN="center"
56VALIGN="bottom"
57></TD
58><TD
59WIDTH="10%"
60ALIGN="right"
61VALIGN="bottom"
62><A
63HREF="function.socket-getsockname.html"
64ACCESSKEY="N"
65>Dal¹í</A
66></TD
67></TR
68></TABLE
69><HR
70ALIGN="LEFT"
71WIDTH="100%"></DIV
72><H1
73><A
74NAME="function.socket-getpeername"
75></A
76>socket_getpeername</H1
77><DIV
78CLASS="refnamediv"
79><A
80NAME="AEN80711"
81></A
82><P
83> (PHP 4 &#62;= 4.1.0)</P
84>socket_getpeername&nbsp;--&nbsp;
85 Queries the remote side of the given socket which may either result in host/port
86 or in a UNIX filesystem path, dependent on its type.
87 </DIV
88><DIV
89CLASS="refsect1"
90><A
91NAME="AEN80714"
92></A
93><H2
94>Description</H2
95>bool <B
96CLASS="methodname"
97>socket_getpeername</B
98> ( resource socket, string &#38;addr [, int &#38;port])<BR
99></BR
100><DIV
101CLASS="warning"
102><P
103></P
104><TABLE
105CLASS="warning"
106BORDER="1"
107WIDTH="100%"
108><TR
109><TD
110ALIGN="CENTER"
111><B
112>Varování</B
113></TD
114></TR
115><TR
116><TD
117ALIGN="LEFT"
118><P
119>Tato funkce je
120<SPAN
121CLASS="emphasis"
122><I
123CLASS="emphasis"
124>EXPERIMENTÁLNÍ</I
125></SPAN
126>. Chování této funkce, její
127název a v¹echno ostatní, co je zde zdokumentováno, se v budoucích verzích
128PHP mù¾e BEZ OHLÁ©ENÍ zmìnit. Berte to v úvahu a pou¾ívejte tuto funkci na
129vlastní nebezpeèí.</P
130></TD
131></TR
132></TABLE
133></DIV
134><P
135>&#13; If the given socket is of type <TT
136CLASS="constant"
137><B
138>AF_INET</B
139></TT
140>,
141 <B
142CLASS="function"
143>socket_getpeername()</B
144> will return the peers (remote)
145 <SPAN
146CLASS="emphasis"
147><I
148CLASS="emphasis"
149>IP address</I
150></SPAN
151> in dotted-quad notation (e.g.
152 <TT
153CLASS="literal"
154>127.0.0.1</TT
155>) in the <TT
156CLASS="parameter"
157><I
158>address</I
159></TT
160>
161 parameter and, if the optional <TT
162CLASS="parameter"
163><I
164>port</I
165></TT
166> parameter is
167 present, also the associated port.
168 </P
169><P
170>&#13; If the given socket is of type <TT
171CLASS="constant"
172><B
173>AF_UNIX</B
174></TT
175>,
176 <B
177CLASS="function"
178>socket_getpeername()</B
179> will return the UNIX filesystem
180 path (e.g. <TT
181CLASS="literal"
182>/var/run/daemon.sock</TT
183>) in the
184 <TT
185CLASS="parameter"
186><I
187>address</I
188></TT
189> parameter.
190 </P
191><P
192>&#13; Vrací <TT
193CLASS="constant"
194><B
195>TRUE</B
196></TT
197> pøi úspìchu, <TT
198CLASS="constant"
199><B
200>FALSE</B
201></TT
202> pøi selhání. <B
203CLASS="function"
204>socket_getpeername()</B
205> may also return
206 <TT
207CLASS="constant"
208><B
209>FALSE</B
210></TT
211> if the socket type is not any of <TT
212CLASS="constant"
213><B
214>AF_INET</B
215></TT
216> or
217 <TT
218CLASS="constant"
219><B
220>AF_UNIX</B
221></TT
222>, in which case the last socket error code is
223 <SPAN
224CLASS="emphasis"
225><I
226CLASS="emphasis"
227>not</I
228></SPAN
229> updated.
230 </P
231><P
232>&#13; See also
233 <B
234CLASS="function"
235>socket_getpeername()</B
236>,
237 <A
238HREF="function.socket-last-error.html"
239><B
240CLASS="function"
241>socket_last_error()</B
242></A
243> and
244 <A
245HREF="function.socket-strerror.html"
246><B
247CLASS="function"
248>socket_strerror()</B
249></A
250>.
251 </P
252></DIV
253><DIV
254CLASS="NAVFOOTER"
255><HR
256ALIGN="LEFT"
257WIDTH="100%"><TABLE
258SUMMARY="Footer navigation table"
259WIDTH="100%"
260BORDER="0"
261CELLPADDING="0"
262CELLSPACING="0"
263><TR
264><TD
265WIDTH="33%"
266ALIGN="left"
267VALIGN="top"
268><A
269HREF="function.socket-get-option.html"
270ACCESSKEY="P"
271>Pøedcházející</A
272></TD
273><TD
274WIDTH="34%"
275ALIGN="center"
276VALIGN="top"
277><A
278HREF="index.html"
279ACCESSKEY="H"
280>Domù</A
281></TD
282><TD
283WIDTH="33%"
284ALIGN="right"
285VALIGN="top"
286><A
287HREF="function.socket-getsockname.html"
288ACCESSKEY="N"
289>Dal¹í</A
290></TD
291></TR
292><TR
293><TD
294WIDTH="33%"
295ALIGN="left"
296VALIGN="top"
297>socket_get_option</TD
298><TD
299WIDTH="34%"
300ALIGN="center"
301VALIGN="top"
302><A
303HREF="ref.sockets.html"
304ACCESSKEY="U"
305>Nahoru</A
306></TD
307><TD
308WIDTH="33%"
309ALIGN="right"
310VALIGN="top"
311>socket_getsockname</TD
312></TR
313></TABLE
314></DIV
315></BODY
316></HTML
317>
Note: See TracBrowser for help on using the repository browser.