Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87fa3aa

Browse files
committed
Add notes that fromfd() and s.makefile() are Unix-specific.
This fixes SF bug #495896. Fix up various markup consistency & style guide conformance nits.
1 parent 09aa55a commit 87fa3aa

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

Doc/lib/libsocket.tex

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,22 @@ \section{\module{socket} ---
9090

9191
\begin{excdesc}{herror}
9292
This exception is raised for address-related errors, i.e. for
93-
functions that use \var{h_errno} in C API, including
94-
\function{gethostbyname_ex} and \function{gethostbyaddr}.
93+
functions that use \var{h_errno} in the C API, including
94+
\function{gethostbyname_ex()} and \function{gethostbyaddr()}.
9595

9696
The accompanying value is a pair \code{(\var{h_errno}, \var{string})}
9797
representing an error returned by a library call. \var{string}
9898
represents the description of \var{h_errno}, as returned by
99-
\cfunction{hstrerror} C API.
99+
the \cfunction{hstrerror()} C function.
100100
\end{excdesc}
101101

102102
\begin{excdesc}{gaierror}
103103
This exception is raised for address-related errors, for
104-
\function{getaddrinfo} and \function{getnameinfo}.
104+
\function{getaddrinfo()} and \function{getnameinfo()}.
105105
The accompanying value is a pair \code{(\var{error}, \var{string})}
106106
representing an error returned by a library call.
107107
\var{string} represents the description of \var{error}, as returned
108-
by \cfunction{gai_strerror} C API.
108+
by the \cfunction{gai_strerror()} C function.
109109
\end{excdesc}
110110

111111
\begin{datadesc}{AF_UNIX}
@@ -189,7 +189,7 @@ \section{\module{socket} ---
189189

190190
\begin{funcdesc}{gethostbyname}{hostname}
191191
Translate a host name to IPv4 address format. The IPv4 address is
192-
returned as a string, e.g., \code{'100.50.200.5'}. If the host name
192+
returned as a string, such as \code{'100.50.200.5'}. If the host name
193193
is an IPv4 address itself it is returned unchanged. See
194194
\function{gethostbyname_ex()} for a more complete interface.
195195
\function{gethostbyname()} does not support IPv6 name resolution, and
@@ -243,7 +243,7 @@ \section{\module{socket} ---
243243
\end{funcdesc}
244244

245245
\begin{funcdesc}{getprotobyname}{protocolname}
246-
Translate an Internet protocol name (e.g.\ \code{'icmp'}) to a constant
246+
Translate an Internet protocol name (for example, \code{'icmp'}) to a constant
247247
suitable for passing as the (optional) third argument to the
248248
\function{socket()} function. This is usually only needed for sockets
249249
opened in ``raw'' mode (\constant{SOCK_RAW}); for the normal socket
@@ -282,8 +282,9 @@ \section{\module{socket} ---
282282
checked --- subsequent operations on the object may fail if the file
283283
descriptor is invalid. This function is rarely needed, but can be
284284
used to get or set socket options on a socket passed to a program as
285-
standard input or output (e.g.\ a server started by the \UNIX{} inet
285+
standard input or output (such as a server started by the \UNIX{} inet
286286
daemon).
287+
Availability: \UNIX.
287288
\end{funcdesc}
288289

289290
\begin{funcdesc}{ntohl}{x}
@@ -311,8 +312,8 @@ \section{\module{socket} ---
311312
\end{funcdesc}
312313

313314
\begin{funcdesc}{inet_aton}{ip_string}
314-
Convert an IPv4 address from dotted-quad string format
315-
(e.g.\ '123.45.67.89') to 32-bit packed binary format, as a string four
315+
Convert an IPv4 address from dotted-quad string format (for example,
316+
'123.45.67.89') to 32-bit packed binary format, as a string four
316317
characters in length.
317318

318319
Useful when conversing with a program that uses the standard C library
@@ -331,7 +332,7 @@ \section{\module{socket} ---
331332
\begin{funcdesc}{inet_ntoa}{packed_ip}
332333
Convert a 32-bit packed IPv4 address (a string four characters in
333334
length) to its standard dotted-quad string representation
334-
(e.g. '123.45.67.89').
335+
(for example, '123.45.67.89').
335336

336337
Useful when conversing with a program that uses the standard C library
337338
and needs objects of type \ctype{struct in_addr}, which is the C type
@@ -400,7 +401,7 @@ \subsection{Socket Objects \label{socket-objects}}
400401
\cfunction{connect()} call (other problems, such as ``host not found,''
401402
can still raise exceptions). The error indicator is \code{0} if the
402403
operation succeeded, otherwise the value of the \cdata{errno}
403-
variable. This is useful, e.g., for asynchronous connects.
404+
variable. This is useful to support, for example, asynchronous connects.
404405
\note{This method has historically accepted a pair of
405406
parameters for \constant{AF_INET} addresses instead of only a tuple.
406407
This was never intentional and is no longer be available in Python
@@ -454,6 +455,7 @@ \subsection{Socket Objects \label{socket-objects}}
454455
and \var{bufsize} arguments are interpreted the same way as by the
455456
built-in \function{file()} function; see ``Built-in Functions''
456457
(section \ref{built-in-funcs}) for more information.
458+
Availability: \UNIX.
457459
\end{methoddesc}
458460

459461
\begin{methoddesc}[socket]{recv}{bufsize\optional{, flags}}

0 commit comments

Comments
 (0)