[Python-checkins] python/dist/src/Doc/lib libsocket.tex,1.66,1.67

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Fri, 07 Jun 2002 05:38:25 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv11978

Modified Files:
	libsocket.tex 
Log Message:
Clarify the interaction between timeout/non-blocking mode, makefile
and fromfd.


Index: libsocket.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsocket.tex,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** libsocket.tex	7 Jun 2002 12:36:44 -0000	1.66
--- libsocket.tex	7 Jun 2002 12:38:23 -0000	1.67
***************
*** 285,289 ****
  used to get or set socket options on a socket passed to a program as
  standard input or output (such as a server started by the \UNIX{} inet
! daemon).  The socket is assumed to be created in blocking mode without
  a timeout.
  Availability: \UNIX.
--- 285,289 ----
  used to get or set socket options on a socket passed to a program as
  standard input or output (such as a server started by the \UNIX{} inet
! daemon).  The socket is assumed to be in blocking mode without
  a timeout.
  Availability: \UNIX.
***************
*** 456,459 ****
--- 456,460 ----
  socket file descriptor, so the file object and socket object may be
  closed or garbage-collected independently.
+ The socket should be in blocking mode.
  \index{I/O control!buffering}The optional \var{mode}
  and \var{bufsize} arguments are interpreted the same way as by the
***************
*** 546,549 ****
--- 547,558 ----
  but is implemented different than setting the socket in non-blocking
  mode (this could be considered a bug and may even be fixed).
+ 
+ Timeout mode internally sets the socket in non-blocking mode.  The
+ blocking and timeout modes are shared between file descriptors and
+ socket objects that refer to the same network endpoint.  A consequence
+ of this is that file objects returned by the \method{makefile()}
+ method should only be used when the socket is in blocking mode; in
+ timeout or non-blocking mode file operations that cannot be completed
+ immediately will fail.
  
  \begin{methoddesc}[socket]{setsockopt}{level, optname, value}