PageRenderTime 84ms CodeModel.GetById 3ms app.highlight 68ms RepoModel.GetById 1ms app.codeStats 1ms

/socket.html

https://bitbucket.org/lbesson/mpri-bomberman
HTML | 1079 lines | 981 code | 98 blank | 0 comment | 0 complexity | 4c0d84cdabd49cf9f8982a3cf1d2c4ef MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1
  2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3<html><head><title>Python: module socket</title>
  4</head><body bgcolor="#f0f0f8">
  5
  6<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
  7<tr bgcolor="#7799ee">
  8<td valign=bottom>&nbsp;<br>
  9<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>socket</strong></big></big></font></td
 10><td align=right valign=bottom
 11><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/lib/python2.7/socket.py">/usr/lib/python2.7/socket.py</a><br><a href="http://docs.python.org/library/socket">Module Docs</a></font></td></tr></table>
 12    <p><tt>This&nbsp;module&nbsp;provides&nbsp;<a href="#socket">socket</a>&nbsp;operations&nbsp;and&nbsp;some&nbsp;related&nbsp;functions.<br>
 13On&nbsp;Unix,&nbsp;it&nbsp;supports&nbsp;IP&nbsp;(Internet&nbsp;Protocol)&nbsp;and&nbsp;Unix&nbsp;domain&nbsp;sockets.<br>
 14On&nbsp;other&nbsp;systems,&nbsp;it&nbsp;only&nbsp;supports&nbsp;IP.&nbsp;Functions&nbsp;specific&nbsp;for&nbsp;a<br>
 15<a href="#socket">socket</a>&nbsp;are&nbsp;available&nbsp;as&nbsp;methods&nbsp;of&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>.<br>
 16&nbsp;<br>
 17Functions:<br>
 18&nbsp;<br>
 19<a href="#socket">socket</a>()&nbsp;--&nbsp;create&nbsp;a&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a><br>
 20<a href="#-socketpair">socketpair</a>()&nbsp;--&nbsp;create&nbsp;a&nbsp;pair&nbsp;of&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;objects&nbsp;[*]<br>
 21<a href="#-fromfd">fromfd</a>()&nbsp;--&nbsp;create&nbsp;a&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;from&nbsp;an&nbsp;open&nbsp;file&nbsp;descriptor&nbsp;[*]<br>
 22<a href="#-gethostname">gethostname</a>()&nbsp;--&nbsp;return&nbsp;the&nbsp;current&nbsp;hostname<br>
 23<a href="#-gethostbyname">gethostbyname</a>()&nbsp;--&nbsp;map&nbsp;a&nbsp;hostname&nbsp;to&nbsp;its&nbsp;IP&nbsp;number<br>
 24<a href="#-gethostbyaddr">gethostbyaddr</a>()&nbsp;--&nbsp;map&nbsp;an&nbsp;IP&nbsp;number&nbsp;or&nbsp;hostname&nbsp;to&nbsp;DNS&nbsp;info<br>
 25<a href="#-getservbyname">getservbyname</a>()&nbsp;--&nbsp;map&nbsp;a&nbsp;service&nbsp;name&nbsp;and&nbsp;a&nbsp;protocol&nbsp;name&nbsp;to&nbsp;a&nbsp;port&nbsp;number<br>
 26<a href="#-getprotobyname">getprotobyname</a>()&nbsp;--&nbsp;map&nbsp;a&nbsp;protocol&nbsp;name&nbsp;(e.g.&nbsp;'tcp')&nbsp;to&nbsp;a&nbsp;number<br>
 27<a href="#-ntohs">ntohs</a>(),&nbsp;<a href="#-ntohl">ntohl</a>()&nbsp;--&nbsp;convert&nbsp;16,&nbsp;32&nbsp;bit&nbsp;int&nbsp;from&nbsp;network&nbsp;to&nbsp;host&nbsp;byte&nbsp;order<br>
 28<a href="#-htons">htons</a>(),&nbsp;<a href="#-htonl">htonl</a>()&nbsp;--&nbsp;convert&nbsp;16,&nbsp;32&nbsp;bit&nbsp;int&nbsp;from&nbsp;host&nbsp;to&nbsp;network&nbsp;byte&nbsp;order<br>
 29<a href="#-inet_aton">inet_aton</a>()&nbsp;--&nbsp;convert&nbsp;IP&nbsp;addr&nbsp;string&nbsp;(123.45.67.89)&nbsp;to&nbsp;32-bit&nbsp;packed&nbsp;format<br>
 30<a href="#-inet_ntoa">inet_ntoa</a>()&nbsp;--&nbsp;convert&nbsp;32-bit&nbsp;packed&nbsp;format&nbsp;IP&nbsp;to&nbsp;string&nbsp;(123.45.67.89)<br>
 31ssl()&nbsp;--&nbsp;secure&nbsp;<a href="#socket">socket</a>&nbsp;layer&nbsp;support&nbsp;(only&nbsp;available&nbsp;if&nbsp;configured)<br>
 32<a href="#socket">socket</a>.<a href="#-getdefaulttimeout">getdefaulttimeout</a>()&nbsp;--&nbsp;get&nbsp;the&nbsp;default&nbsp;<a href="#timeout">timeout</a>&nbsp;value<br>
 33<a href="#socket">socket</a>.<a href="#-setdefaulttimeout">setdefaulttimeout</a>()&nbsp;--&nbsp;set&nbsp;the&nbsp;default&nbsp;<a href="#timeout">timeout</a>&nbsp;value<br>
 34<a href="#-create_connection">create_connection</a>()&nbsp;--&nbsp;connects&nbsp;to&nbsp;an&nbsp;address,&nbsp;with&nbsp;an&nbsp;optional&nbsp;<a href="#timeout">timeout</a>&nbsp;and<br>
 35&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;optional&nbsp;source&nbsp;address.<br>
 36&nbsp;<br>
 37&nbsp;[*]&nbsp;not&nbsp;available&nbsp;on&nbsp;all&nbsp;platforms!<br>
 38&nbsp;<br>
 39Special&nbsp;objects:<br>
 40&nbsp;<br>
 41<a href="#SocketType">SocketType</a>&nbsp;--&nbsp;type&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;for&nbsp;<a href="#socket">socket</a>&nbsp;objects<br>
 42<a href="#error">error</a>&nbsp;--&nbsp;exception&nbsp;raised&nbsp;for&nbsp;I/O&nbsp;errors<br>
 43has_ipv6&nbsp;--&nbsp;boolean&nbsp;value&nbsp;indicating&nbsp;if&nbsp;IPv6&nbsp;is&nbsp;supported<br>
 44&nbsp;<br>
 45Integer&nbsp;constants:<br>
 46&nbsp;<br>
 47AF_INET,&nbsp;AF_UNIX&nbsp;--&nbsp;<a href="#socket">socket</a>&nbsp;domains&nbsp;(first&nbsp;argument&nbsp;to&nbsp;<a href="#socket">socket</a>()&nbsp;call)<br>
 48SOCK_STREAM,&nbsp;SOCK_DGRAM,&nbsp;SOCK_RAW&nbsp;--&nbsp;<a href="#socket">socket</a>&nbsp;types&nbsp;(second&nbsp;argument)<br>
 49&nbsp;<br>
 50Many&nbsp;other&nbsp;constants&nbsp;may&nbsp;be&nbsp;defined;&nbsp;these&nbsp;may&nbsp;be&nbsp;used&nbsp;in&nbsp;calls&nbsp;to<br>
 51the&nbsp;setsockopt()&nbsp;and&nbsp;getsockopt()&nbsp;methods.</tt></p>
 52<p>
 53<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 54<tr bgcolor="#aa55cc">
 55<td colspan=3 valign=bottom>&nbsp;<br>
 56<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
 57    
 58<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 59<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="_socket.html">_socket</a><br>
 60<a href="_ssl.html">_ssl</a><br>
 61</td><td width="25%" valign=top><a href="errno.html">errno</a><br>
 62<a href="os.html">os</a><br>
 63</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
 64<a href="warnings.html">warnings</a><br>
 65</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 66<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 67<tr bgcolor="#ee77aa">
 68<td colspan=3 valign=bottom>&nbsp;<br>
 69<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
 70    
 71<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 72<td width="100%"><dl>
 73<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
 74</font></dt><dd>
 75<dl>
 76<dt><font face="helvetica, arial"><a href="socket.html#_socketobject">_socketobject</a>
 77</font></dt><dt><font face="helvetica, arial"><a href="socket.html#_socketobject">_socketobject</a>
 78</font></dt></dl>
 79</dd>
 80<dt><font face="helvetica, arial"><a href="exceptions.html#IOError">exceptions.IOError</a>(<a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a>)
 81</font></dt><dd>
 82<dl>
 83<dt><font face="helvetica, arial"><a href="socket.html#error">error</a>
 84</font></dt><dd>
 85<dl>
 86<dt><font face="helvetica, arial"><a href="socket.html#gaierror">gaierror</a>
 87</font></dt><dt><font face="helvetica, arial"><a href="socket.html#herror">herror</a>
 88</font></dt><dt><font face="helvetica, arial"><a href="socket.html#timeout">timeout</a>
 89</font></dt></dl>
 90</dd>
 91</dl>
 92</dd>
 93</dl>
 94 <p>
 95<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 96<tr bgcolor="#ffc8d8">
 97<td colspan=3 valign=bottom>&nbsp;<br>
 98<font color="#000000" face="helvetica, arial"><strong>SocketType</strong> = <a name="SocketType">class _socketobject</a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
 99    
100<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
101<td colspan=2><tt><a href="#socket">socket</a>([family[,&nbsp;type[,&nbsp;proto]]])&nbsp;-&gt;&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a><br>
102&nbsp;<br>
103Open&nbsp;a&nbsp;<a href="#socket">socket</a>&nbsp;of&nbsp;the&nbsp;given&nbsp;type.&nbsp;&nbsp;The&nbsp;family&nbsp;argument&nbsp;specifies&nbsp;the<br>
104address&nbsp;family;&nbsp;it&nbsp;defaults&nbsp;to&nbsp;AF_INET.&nbsp;&nbsp;The&nbsp;type&nbsp;argument&nbsp;specifies<br>
105whether&nbsp;this&nbsp;is&nbsp;a&nbsp;stream&nbsp;(SOCK_STREAM,&nbsp;this&nbsp;is&nbsp;the&nbsp;default)<br>
106or&nbsp;datagram&nbsp;(SOCK_DGRAM)&nbsp;<a href="#socket">socket</a>.&nbsp;&nbsp;The&nbsp;protocol&nbsp;argument&nbsp;defaults&nbsp;to&nbsp;0,<br>
107specifying&nbsp;the&nbsp;default&nbsp;protocol.&nbsp;&nbsp;Keyword&nbsp;arguments&nbsp;are&nbsp;accepted.<br>
108&nbsp;<br>
109A&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;represents&nbsp;one&nbsp;endpoint&nbsp;of&nbsp;a&nbsp;network&nbsp;connection.<br>
110&nbsp;<br>
111Methods&nbsp;of&nbsp;<a href="#socket">socket</a>&nbsp;objects&nbsp;(keyword&nbsp;arguments&nbsp;not&nbsp;allowed):<br>
112&nbsp;<br>
113<a href="#SocketType-accept">accept</a>()&nbsp;--&nbsp;accept&nbsp;a&nbsp;connection,&nbsp;returning&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;and&nbsp;client&nbsp;address<br>
114<a href="#SocketType-bind">bind</a>(addr)&nbsp;--&nbsp;bind&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;a&nbsp;local&nbsp;address<br>
115<a href="#SocketType-close">close</a>()&nbsp;--&nbsp;close&nbsp;the&nbsp;<a href="#socket">socket</a><br>
116<a href="#SocketType-connect">connect</a>(addr)&nbsp;--&nbsp;connect&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;a&nbsp;remote&nbsp;address<br>
117<a href="#SocketType-connect_ex">connect_ex</a>(addr)&nbsp;--&nbsp;connect,&nbsp;return&nbsp;an&nbsp;<a href="#error">error</a>&nbsp;code&nbsp;instead&nbsp;of&nbsp;an&nbsp;exception<br>
118<a href="#SocketType-dup">dup</a>()&nbsp;--&nbsp;return&nbsp;a&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;identical&nbsp;to&nbsp;the&nbsp;current&nbsp;one&nbsp;[*]<br>
119<a href="#SocketType-fileno">fileno</a>()&nbsp;--&nbsp;return&nbsp;underlying&nbsp;file&nbsp;descriptor<br>
120<a href="#SocketType-getpeername">getpeername</a>()&nbsp;--&nbsp;return&nbsp;remote&nbsp;address&nbsp;[*]<br>
121<a href="#SocketType-getsockname">getsockname</a>()&nbsp;--&nbsp;return&nbsp;local&nbsp;address<br>
122<a href="#SocketType-getsockopt">getsockopt</a>(level,&nbsp;optname[,&nbsp;buflen])&nbsp;--&nbsp;get&nbsp;<a href="#socket">socket</a>&nbsp;options<br>
123<a href="#SocketType-gettimeout">gettimeout</a>()&nbsp;--&nbsp;return&nbsp;<a href="#timeout">timeout</a>&nbsp;or&nbsp;None<br>
124<a href="#SocketType-listen">listen</a>(n)&nbsp;--&nbsp;start&nbsp;listening&nbsp;for&nbsp;incoming&nbsp;connections<br>
125<a href="#SocketType-makefile">makefile</a>([mode,&nbsp;[bufsize]])&nbsp;--&nbsp;return&nbsp;a&nbsp;file&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;for&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;[*]<br>
126<a href="#SocketType-recv">recv</a>(buflen[,&nbsp;flags])&nbsp;--&nbsp;receive&nbsp;data<br>
127<a href="#SocketType-recv_into">recv_into</a>(buffer[,&nbsp;nbytes[,&nbsp;flags]])&nbsp;--&nbsp;receive&nbsp;data&nbsp;(into&nbsp;a&nbsp;buffer)<br>
128<a href="#SocketType-recvfrom">recvfrom</a>(buflen[,&nbsp;flags])&nbsp;--&nbsp;receive&nbsp;data&nbsp;and&nbsp;sender's&nbsp;address<br>
129<a href="#SocketType-recvfrom_into">recvfrom_into</a>(buffer[,&nbsp;nbytes,&nbsp;[,&nbsp;flags])<br>
130&nbsp;&nbsp;--&nbsp;receive&nbsp;data&nbsp;and&nbsp;sender's&nbsp;address&nbsp;(into&nbsp;a&nbsp;buffer)<br>
131<a href="#SocketType-sendall">sendall</a>(data[,&nbsp;flags])&nbsp;--&nbsp;send&nbsp;all&nbsp;data<br>
132<a href="#SocketType-send">send</a>(data[,&nbsp;flags])&nbsp;--&nbsp;send&nbsp;data,&nbsp;may&nbsp;not&nbsp;send&nbsp;all&nbsp;of&nbsp;it<br>
133<a href="#SocketType-sendto">sendto</a>(data[,&nbsp;flags],&nbsp;addr)&nbsp;--&nbsp;send&nbsp;data&nbsp;to&nbsp;a&nbsp;given&nbsp;address<br>
134<a href="#SocketType-setblocking">setblocking</a>(0&nbsp;|&nbsp;1)&nbsp;--&nbsp;set&nbsp;or&nbsp;clear&nbsp;the&nbsp;blocking&nbsp;I/O&nbsp;flag<br>
135<a href="#SocketType-setsockopt">setsockopt</a>(level,&nbsp;optname,&nbsp;value)&nbsp;--&nbsp;set&nbsp;<a href="#socket">socket</a>&nbsp;options<br>
136<a href="#SocketType-settimeout">settimeout</a>(None&nbsp;|&nbsp;float)&nbsp;--&nbsp;set&nbsp;or&nbsp;clear&nbsp;the&nbsp;<a href="#timeout">timeout</a><br>
137<a href="#SocketType-shutdown">shutdown</a>(how)&nbsp;--&nbsp;shut&nbsp;down&nbsp;traffic&nbsp;in&nbsp;one&nbsp;or&nbsp;both&nbsp;directions<br>
138&nbsp;<br>
139&nbsp;[*]&nbsp;not&nbsp;available&nbsp;on&nbsp;all&nbsp;platforms!<br>&nbsp;</tt></td></tr>
140<tr><td>&nbsp;</td>
141<td width="100%">Methods defined here:<br>
142<dl><dt><a name="_socketobject-__init__"><strong>__init__</strong></a>(self, family<font color="#909090">=2</font>, type<font color="#909090">=1</font>, proto<font color="#909090">=0</font>, _sock<font color="#909090">=None</font>)</dt></dl>
143
144<dl><dt><a name="_socketobject-accept"><strong>accept</strong></a>(self)</dt><dd><tt><a href="#SocketType-accept">accept</a>()&nbsp;-&gt;&nbsp;(<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;address&nbsp;info)<br>
145&nbsp;<br>
146Wait&nbsp;for&nbsp;an&nbsp;incoming&nbsp;connection.&nbsp;&nbsp;Return&nbsp;a&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;representing&nbsp;the<br>
147connection,&nbsp;and&nbsp;the&nbsp;address&nbsp;of&nbsp;the&nbsp;client.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address<br>
148info&nbsp;is&nbsp;a&nbsp;pair&nbsp;(hostaddr,&nbsp;port).</tt></dd></dl>
149
150<dl><dt><a name="_socketobject-bind"><strong>bind</strong></a>(...)</dt><dd><tt><a href="#SocketType-bind">bind</a>(address)<br>
151&nbsp;<br>
152Bind&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;a&nbsp;local&nbsp;address.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address&nbsp;is&nbsp;a<br>
153pair&nbsp;(host,&nbsp;port);&nbsp;the&nbsp;host&nbsp;must&nbsp;refer&nbsp;to&nbsp;the&nbsp;local&nbsp;host.&nbsp;For&nbsp;raw&nbsp;packet<br>
154sockets&nbsp;the&nbsp;address&nbsp;is&nbsp;a&nbsp;tuple&nbsp;(ifname,&nbsp;proto&nbsp;[,pkttype&nbsp;[,hatype]])</tt></dd></dl>
155
156<dl><dt><a name="_socketobject-close"><strong>close</strong></a>(self, _closedsocket<font color="#909090">=&lt;class 'socket._closedsocket'&gt;</font>, _delegate_methods<font color="#909090">=('recv', 'recvfrom', 'recv_into', 'recvfrom_into', 'send', 'sendto')</font>, setattr<font color="#909090">=&lt;built-in function setattr&gt;</font>)</dt><dd><tt><a href="#SocketType-close">close</a>()<br>
157&nbsp;<br>
158Close&nbsp;the&nbsp;<a href="#socket">socket</a>.&nbsp;&nbsp;It&nbsp;cannot&nbsp;be&nbsp;used&nbsp;after&nbsp;this&nbsp;call.</tt></dd></dl>
159
160<dl><dt><a name="_socketobject-connect"><strong>connect</strong></a>(...)</dt><dd><tt><a href="#SocketType-connect">connect</a>(address)<br>
161&nbsp;<br>
162Connect&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;a&nbsp;remote&nbsp;address.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address<br>
163is&nbsp;a&nbsp;pair&nbsp;(host,&nbsp;port).</tt></dd></dl>
164
165<dl><dt><a name="_socketobject-connect_ex"><strong>connect_ex</strong></a>(...)</dt><dd><tt><a href="#SocketType-connect_ex">connect_ex</a>(address)&nbsp;-&gt;&nbsp;errno<br>
166&nbsp;<br>
167This&nbsp;is&nbsp;like&nbsp;<a href="#SocketType-connect">connect</a>(address),&nbsp;but&nbsp;returns&nbsp;an&nbsp;<a href="#error">error</a>&nbsp;code&nbsp;(the&nbsp;errno&nbsp;value)<br>
168instead&nbsp;of&nbsp;raising&nbsp;an&nbsp;exception&nbsp;when&nbsp;an&nbsp;<a href="#error">error</a>&nbsp;occurs.</tt></dd></dl>
169
170<dl><dt><a name="_socketobject-dup"><strong>dup</strong></a>(self)</dt><dd><tt><a href="#SocketType-dup">dup</a>()&nbsp;-&gt;&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a><br>
171&nbsp;<br>
172Return&nbsp;a&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;connected&nbsp;to&nbsp;the&nbsp;same&nbsp;system&nbsp;resource.</tt></dd></dl>
173
174<dl><dt><a name="_socketobject-fileno"><strong>fileno</strong></a>(...)</dt><dd><tt><a href="#SocketType-fileno">fileno</a>()&nbsp;-&gt;&nbsp;integer<br>
175&nbsp;<br>
176Return&nbsp;the&nbsp;integer&nbsp;file&nbsp;descriptor&nbsp;of&nbsp;the&nbsp;<a href="#socket">socket</a>.</tt></dd></dl>
177
178<dl><dt><a name="_socketobject-getpeername"><strong>getpeername</strong></a>(...)</dt><dd><tt><a href="#SocketType-getpeername">getpeername</a>()&nbsp;-&gt;&nbsp;address&nbsp;info<br>
179&nbsp;<br>
180Return&nbsp;the&nbsp;address&nbsp;of&nbsp;the&nbsp;remote&nbsp;endpoint.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address<br>
181info&nbsp;is&nbsp;a&nbsp;pair&nbsp;(hostaddr,&nbsp;port).</tt></dd></dl>
182
183<dl><dt><a name="_socketobject-getsockname"><strong>getsockname</strong></a>(...)</dt><dd><tt><a href="#SocketType-getsockname">getsockname</a>()&nbsp;-&gt;&nbsp;address&nbsp;info<br>
184&nbsp;<br>
185Return&nbsp;the&nbsp;address&nbsp;of&nbsp;the&nbsp;local&nbsp;endpoint.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address<br>
186info&nbsp;is&nbsp;a&nbsp;pair&nbsp;(hostaddr,&nbsp;port).</tt></dd></dl>
187
188<dl><dt><a name="_socketobject-getsockopt"><strong>getsockopt</strong></a>(...)</dt><dd><tt><a href="#SocketType-getsockopt">getsockopt</a>(level,&nbsp;option[,&nbsp;buffersize])&nbsp;-&gt;&nbsp;value<br>
189&nbsp;<br>
190Get&nbsp;a&nbsp;<a href="#socket">socket</a>&nbsp;option.&nbsp;&nbsp;See&nbsp;the&nbsp;Unix&nbsp;manual&nbsp;for&nbsp;level&nbsp;and&nbsp;option.<br>
191If&nbsp;a&nbsp;nonzero&nbsp;buffersize&nbsp;argument&nbsp;is&nbsp;given,&nbsp;the&nbsp;return&nbsp;value&nbsp;is&nbsp;a<br>
192string&nbsp;of&nbsp;that&nbsp;length;&nbsp;otherwise&nbsp;it&nbsp;is&nbsp;an&nbsp;integer.</tt></dd></dl>
193
194<dl><dt><a name="_socketobject-gettimeout"><strong>gettimeout</strong></a>(...)</dt><dd><tt><a href="#SocketType-gettimeout">gettimeout</a>()&nbsp;-&gt;&nbsp;<a href="#timeout">timeout</a><br>
195&nbsp;<br>
196Returns&nbsp;the&nbsp;<a href="#timeout">timeout</a>&nbsp;in&nbsp;seconds&nbsp;(float)&nbsp;associated&nbsp;with&nbsp;<a href="#socket">socket</a>&nbsp;<br>
197operations.&nbsp;A&nbsp;<a href="#timeout">timeout</a>&nbsp;of&nbsp;None&nbsp;indicates&nbsp;that&nbsp;timeouts&nbsp;on&nbsp;<a href="#socket">socket</a>&nbsp;<br>
198operations&nbsp;are&nbsp;disabled.</tt></dd></dl>
199
200<dl><dt><a name="_socketobject-listen"><strong>listen</strong></a>(...)</dt><dd><tt><a href="#SocketType-listen">listen</a>(backlog)<br>
201&nbsp;<br>
202Enable&nbsp;a&nbsp;server&nbsp;to&nbsp;accept&nbsp;connections.&nbsp;&nbsp;The&nbsp;backlog&nbsp;argument&nbsp;must&nbsp;be&nbsp;at<br>
203least&nbsp;0&nbsp;(if&nbsp;it&nbsp;is&nbsp;lower,&nbsp;it&nbsp;is&nbsp;set&nbsp;to&nbsp;0);&nbsp;it&nbsp;specifies&nbsp;the&nbsp;number&nbsp;of<br>
204unaccepted&nbsp;connections&nbsp;that&nbsp;the&nbsp;system&nbsp;will&nbsp;allow&nbsp;before&nbsp;refusing&nbsp;new<br>
205connections.</tt></dd></dl>
206
207<dl><dt><a name="_socketobject-makefile"><strong>makefile</strong></a>(self, mode<font color="#909090">='r'</font>, bufsize<font color="#909090">=-1</font>)</dt><dd><tt><a href="#SocketType-makefile">makefile</a>([mode[,&nbsp;bufsize]])&nbsp;-&gt;&nbsp;file&nbsp;<a href="__builtin__.html#object">object</a><br>
208&nbsp;<br>
209Return&nbsp;a&nbsp;regular&nbsp;file&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;corresponding&nbsp;to&nbsp;the&nbsp;<a href="#socket">socket</a>.&nbsp;&nbsp;The&nbsp;mode<br>
210and&nbsp;bufsize&nbsp;arguments&nbsp;are&nbsp;as&nbsp;for&nbsp;the&nbsp;built-in&nbsp;open()&nbsp;function.</tt></dd></dl>
211
212<dl><dt><a name="_socketobject-sendall"><strong>sendall</strong></a>(...)</dt><dd><tt><a href="#SocketType-sendall">sendall</a>(data[,&nbsp;flags])<br>
213&nbsp;<br>
214Send&nbsp;a&nbsp;data&nbsp;string&nbsp;to&nbsp;the&nbsp;<a href="#socket">socket</a>.&nbsp;&nbsp;For&nbsp;the&nbsp;optional&nbsp;flags<br>
215argument,&nbsp;see&nbsp;the&nbsp;Unix&nbsp;manual.&nbsp;&nbsp;This&nbsp;calls&nbsp;<a href="#SocketType-send">send</a>()&nbsp;repeatedly<br>
216until&nbsp;all&nbsp;data&nbsp;is&nbsp;sent.&nbsp;&nbsp;If&nbsp;an&nbsp;<a href="#error">error</a>&nbsp;occurs,&nbsp;it's&nbsp;impossible<br>
217to&nbsp;tell&nbsp;how&nbsp;much&nbsp;data&nbsp;has&nbsp;been&nbsp;sent.</tt></dd></dl>
218
219<dl><dt><a name="_socketobject-setblocking"><strong>setblocking</strong></a>(...)</dt><dd><tt><a href="#SocketType-setblocking">setblocking</a>(flag)<br>
220&nbsp;<br>
221Set&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;blocking&nbsp;(flag&nbsp;is&nbsp;true)&nbsp;or&nbsp;non-blocking&nbsp;(false).<br>
222<a href="#SocketType-setblocking">setblocking</a>(True)&nbsp;is&nbsp;equivalent&nbsp;to&nbsp;<a href="#SocketType-settimeout">settimeout</a>(None);<br>
223<a href="#SocketType-setblocking">setblocking</a>(False)&nbsp;is&nbsp;equivalent&nbsp;to&nbsp;<a href="#SocketType-settimeout">settimeout</a>(0.0).</tt></dd></dl>
224
225<dl><dt><a name="_socketobject-setsockopt"><strong>setsockopt</strong></a>(...)</dt><dd><tt><a href="#SocketType-setsockopt">setsockopt</a>(level,&nbsp;option,&nbsp;value)<br>
226&nbsp;<br>
227Set&nbsp;a&nbsp;<a href="#socket">socket</a>&nbsp;option.&nbsp;&nbsp;See&nbsp;the&nbsp;Unix&nbsp;manual&nbsp;for&nbsp;level&nbsp;and&nbsp;option.<br>
228The&nbsp;value&nbsp;argument&nbsp;can&nbsp;either&nbsp;be&nbsp;an&nbsp;integer&nbsp;or&nbsp;a&nbsp;string.</tt></dd></dl>
229
230<dl><dt><a name="_socketobject-settimeout"><strong>settimeout</strong></a>(...)</dt><dd><tt><a href="#SocketType-settimeout">settimeout</a>(<a href="#timeout">timeout</a>)<br>
231&nbsp;<br>
232Set&nbsp;a&nbsp;<a href="#timeout">timeout</a>&nbsp;on&nbsp;<a href="#socket">socket</a>&nbsp;operations.&nbsp;&nbsp;'<a href="#timeout">timeout</a>'&nbsp;can&nbsp;be&nbsp;a&nbsp;float,<br>
233giving&nbsp;in&nbsp;seconds,&nbsp;or&nbsp;None.&nbsp;&nbsp;Setting&nbsp;a&nbsp;<a href="#timeout">timeout</a>&nbsp;of&nbsp;None&nbsp;disables<br>
234the&nbsp;<a href="#timeout">timeout</a>&nbsp;feature&nbsp;and&nbsp;is&nbsp;equivalent&nbsp;to&nbsp;<a href="#SocketType-setblocking">setblocking</a>(1).<br>
235Setting&nbsp;a&nbsp;<a href="#timeout">timeout</a>&nbsp;of&nbsp;zero&nbsp;is&nbsp;the&nbsp;same&nbsp;as&nbsp;<a href="#SocketType-setblocking">setblocking</a>(0).</tt></dd></dl>
236
237<dl><dt><a name="_socketobject-shutdown"><strong>shutdown</strong></a>(...)</dt><dd><tt><a href="#SocketType-shutdown">shutdown</a>(flag)<br>
238&nbsp;<br>
239Shut&nbsp;down&nbsp;the&nbsp;reading&nbsp;side&nbsp;of&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;(flag&nbsp;==&nbsp;SHUT_RD),&nbsp;the&nbsp;writing&nbsp;side<br>
240of&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;(flag&nbsp;==&nbsp;SHUT_WR),&nbsp;or&nbsp;both&nbsp;ends&nbsp;(flag&nbsp;==&nbsp;SHUT_RDWR).</tt></dd></dl>
241
242<hr>
243Data descriptors defined here:<br>
244<dl><dt><strong>__weakref__</strong></dt>
245<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
246</dl>
247<dl><dt><strong>family</strong></dt>
248<dd><tt>the&nbsp;socket&nbsp;family</tt></dd>
249</dl>
250<dl><dt><strong>proto</strong></dt>
251<dd><tt>the&nbsp;socket&nbsp;protocol</tt></dd>
252</dl>
253<dl><dt><strong>recv</strong></dt>
254</dl>
255<dl><dt><strong>recv_into</strong></dt>
256</dl>
257<dl><dt><strong>recvfrom</strong></dt>
258</dl>
259<dl><dt><strong>recvfrom_into</strong></dt>
260</dl>
261<dl><dt><strong>send</strong></dt>
262</dl>
263<dl><dt><strong>sendto</strong></dt>
264</dl>
265<dl><dt><strong>type</strong></dt>
266<dd><tt>the&nbsp;socket&nbsp;type</tt></dd>
267</dl>
268</td></tr></table> <p>
269<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
270<tr bgcolor="#ffc8d8">
271<td colspan=3 valign=bottom>&nbsp;<br>
272<font color="#000000" face="helvetica, arial"><a name="error">class <strong>error</strong></a>(<a href="exceptions.html#IOError">exceptions.IOError</a>)</font></td></tr>
273    
274<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
275<td width="100%"><dl><dt>Method resolution order:</dt>
276<dd><a href="socket.html#error">error</a></dd>
277<dd><a href="exceptions.html#IOError">exceptions.IOError</a></dd>
278<dd><a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a></dd>
279<dd><a href="exceptions.html#StandardError">exceptions.StandardError</a></dd>
280<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
281<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
282<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
283</dl>
284<hr>
285Data descriptors defined here:<br>
286<dl><dt><strong>__weakref__</strong></dt>
287<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
288</dl>
289<hr>
290Methods inherited from <a href="exceptions.html#IOError">exceptions.IOError</a>:<br>
291<dl><dt><a name="error-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#error-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>
292
293<hr>
294Data and other attributes inherited from <a href="exceptions.html#IOError">exceptions.IOError</a>:<br>
295<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#error-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
296
297<hr>
298Methods inherited from <a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a>:<br>
299<dl><dt><a name="error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
300
301<dl><dt><a name="error-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#error-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>
302
303<hr>
304Data descriptors inherited from <a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a>:<br>
305<dl><dt><strong>errno</strong></dt>
306<dd><tt>exception&nbsp;errno</tt></dd>
307</dl>
308<dl><dt><strong>filename</strong></dt>
309<dd><tt>exception&nbsp;filename</tt></dd>
310</dl>
311<dl><dt><strong>strerror</strong></dt>
312<dd><tt>exception&nbsp;strerror</tt></dd>
313</dl>
314<hr>
315Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
316<dl><dt><a name="error-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#error-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>
317
318<dl><dt><a name="error-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#error-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
319
320<dl><dt><a name="error-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#error-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
321
322<dl><dt><a name="error-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#error-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
323&nbsp;<br>
324Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
325
326<dl><dt><a name="error-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#error-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
327
328<dl><dt><a name="error-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#error-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>
329
330<dl><dt><a name="error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
331
332<dl><dt><a name="error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
333
334<hr>
335Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
336<dl><dt><strong>__dict__</strong></dt>
337</dl>
338<dl><dt><strong>args</strong></dt>
339</dl>
340<dl><dt><strong>message</strong></dt>
341</dl>
342</td></tr></table> <p>
343<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
344<tr bgcolor="#ffc8d8">
345<td colspan=3 valign=bottom>&nbsp;<br>
346<font color="#000000" face="helvetica, arial"><a name="gaierror">class <strong>gaierror</strong></a>(<a href="socket.html#error">error</a>)</font></td></tr>
347    
348<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
349<td width="100%"><dl><dt>Method resolution order:</dt>
350<dd><a href="socket.html#gaierror">gaierror</a></dd>
351<dd><a href="socket.html#error">error</a></dd>
352<dd><a href="exceptions.html#IOError">exceptions.IOError</a></dd>
353<dd><a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a></dd>
354<dd><a href="exceptions.html#StandardError">exceptions.StandardError</a></dd>
355<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
356<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
357<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
358</dl>
359<hr>
360Data descriptors inherited from <a href="socket.html#error">error</a>:<br>
361<dl><dt><strong>__weakref__</strong></dt>
362<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
363</dl>
364<hr>
365Methods inherited from <a href="exceptions.html#IOError">exceptions.IOError</a>:<br>
366<dl><dt><a name="gaierror-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#gaierror-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>
367
368<hr>
369Data and other attributes inherited from <a href="exceptions.html#IOError">exceptions.IOError</a>:<br>
370<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#gaierror-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
371
372<hr>
373Methods inherited from <a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a>:<br>
374<dl><dt><a name="gaierror-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
375
376<dl><dt><a name="gaierror-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#gaierror-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>
377
378<hr>
379Data descriptors inherited from <a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a>:<br>
380<dl><dt><strong>errno</strong></dt>
381<dd><tt>exception&nbsp;errno</tt></dd>
382</dl>
383<dl><dt><strong>filename</strong></dt>
384<dd><tt>exception&nbsp;filename</tt></dd>
385</dl>
386<dl><dt><strong>strerror</strong></dt>
387<dd><tt>exception&nbsp;strerror</tt></dd>
388</dl>
389<hr>
390Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
391<dl><dt><a name="gaierror-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#gaierror-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>
392
393<dl><dt><a name="gaierror-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#gaierror-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
394
395<dl><dt><a name="gaierror-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#gaierror-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
396
397<dl><dt><a name="gaierror-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#gaierror-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
398&nbsp;<br>
399Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
400
401<dl><dt><a name="gaierror-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#gaierror-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
402
403<dl><dt><a name="gaierror-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#gaierror-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>
404
405<dl><dt><a name="gaierror-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
406
407<dl><dt><a name="gaierror-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
408
409<hr>
410Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
411<dl><dt><strong>__dict__</strong></dt>
412</dl>
413<dl><dt><strong>args</strong></dt>
414</dl>
415<dl><dt><strong>message</strong></dt>
416</dl>
417</td></tr></table> <p>
418<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
419<tr bgcolor="#ffc8d8">
420<td colspan=3 valign=bottom>&nbsp;<br>
421<font color="#000000" face="helvetica, arial"><a name="herror">class <strong>herror</strong></a>(<a href="socket.html#error">error</a>)</font></td></tr>
422    
423<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
424<td width="100%"><dl><dt>Method resolution order:</dt>
425<dd><a href="socket.html#herror">herror</a></dd>
426<dd><a href="socket.html#error">error</a></dd>
427<dd><a href="exceptions.html#IOError">exceptions.IOError</a></dd>
428<dd><a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a></dd>
429<dd><a href="exceptions.html#StandardError">exceptions.StandardError</a></dd>
430<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
431<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
432<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
433</dl>
434<hr>
435Data descriptors inherited from <a href="socket.html#error">error</a>:<br>
436<dl><dt><strong>__weakref__</strong></dt>
437<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
438</dl>
439<hr>
440Methods inherited from <a href="exceptions.html#IOError">exceptions.IOError</a>:<br>
441<dl><dt><a name="herror-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#herror-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>
442
443<hr>
444Data and other attributes inherited from <a href="exceptions.html#IOError">exceptions.IOError</a>:<br>
445<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#herror-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
446
447<hr>
448Methods inherited from <a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a>:<br>
449<dl><dt><a name="herror-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
450
451<dl><dt><a name="herror-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#herror-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>
452
453<hr>
454Data descriptors inherited from <a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a>:<br>
455<dl><dt><strong>errno</strong></dt>
456<dd><tt>exception&nbsp;errno</tt></dd>
457</dl>
458<dl><dt><strong>filename</strong></dt>
459<dd><tt>exception&nbsp;filename</tt></dd>
460</dl>
461<dl><dt><strong>strerror</strong></dt>
462<dd><tt>exception&nbsp;strerror</tt></dd>
463</dl>
464<hr>
465Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
466<dl><dt><a name="herror-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#herror-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>
467
468<dl><dt><a name="herror-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#herror-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
469
470<dl><dt><a name="herror-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#herror-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
471
472<dl><dt><a name="herror-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#herror-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
473&nbsp;<br>
474Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
475
476<dl><dt><a name="herror-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#herror-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
477
478<dl><dt><a name="herror-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#herror-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>
479
480<dl><dt><a name="herror-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
481
482<dl><dt><a name="herror-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
483
484<hr>
485Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
486<dl><dt><strong>__dict__</strong></dt>
487</dl>
488<dl><dt><strong>args</strong></dt>
489</dl>
490<dl><dt><strong>message</strong></dt>
491</dl>
492</td></tr></table> <p>
493<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
494<tr bgcolor="#ffc8d8">
495<td colspan=3 valign=bottom>&nbsp;<br>
496<font color="#000000" face="helvetica, arial"><strong>socket</strong> = <a name="socket">class _socketobject</a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
497    
498<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
499<td colspan=2><tt><a href="#socket">socket</a>([family[,&nbsp;type[,&nbsp;proto]]])&nbsp;-&gt;&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a><br>
500&nbsp;<br>
501Open&nbsp;a&nbsp;<a href="#socket">socket</a>&nbsp;of&nbsp;the&nbsp;given&nbsp;type.&nbsp;&nbsp;The&nbsp;family&nbsp;argument&nbsp;specifies&nbsp;the<br>
502address&nbsp;family;&nbsp;it&nbsp;defaults&nbsp;to&nbsp;AF_INET.&nbsp;&nbsp;The&nbsp;type&nbsp;argument&nbsp;specifies<br>
503whether&nbsp;this&nbsp;is&nbsp;a&nbsp;stream&nbsp;(SOCK_STREAM,&nbsp;this&nbsp;is&nbsp;the&nbsp;default)<br>
504or&nbsp;datagram&nbsp;(SOCK_DGRAM)&nbsp;<a href="#socket">socket</a>.&nbsp;&nbsp;The&nbsp;protocol&nbsp;argument&nbsp;defaults&nbsp;to&nbsp;0,<br>
505specifying&nbsp;the&nbsp;default&nbsp;protocol.&nbsp;&nbsp;Keyword&nbsp;arguments&nbsp;are&nbsp;accepted.<br>
506&nbsp;<br>
507A&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;represents&nbsp;one&nbsp;endpoint&nbsp;of&nbsp;a&nbsp;network&nbsp;connection.<br>
508&nbsp;<br>
509Methods&nbsp;of&nbsp;<a href="#socket">socket</a>&nbsp;objects&nbsp;(keyword&nbsp;arguments&nbsp;not&nbsp;allowed):<br>
510&nbsp;<br>
511<a href="#socket-accept">accept</a>()&nbsp;--&nbsp;accept&nbsp;a&nbsp;connection,&nbsp;returning&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;and&nbsp;client&nbsp;address<br>
512<a href="#socket-bind">bind</a>(addr)&nbsp;--&nbsp;bind&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;a&nbsp;local&nbsp;address<br>
513<a href="#socket-close">close</a>()&nbsp;--&nbsp;close&nbsp;the&nbsp;<a href="#socket">socket</a><br>
514<a href="#socket-connect">connect</a>(addr)&nbsp;--&nbsp;connect&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;a&nbsp;remote&nbsp;address<br>
515<a href="#socket-connect_ex">connect_ex</a>(addr)&nbsp;--&nbsp;connect,&nbsp;return&nbsp;an&nbsp;<a href="#error">error</a>&nbsp;code&nbsp;instead&nbsp;of&nbsp;an&nbsp;exception<br>
516<a href="#socket-dup">dup</a>()&nbsp;--&nbsp;return&nbsp;a&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;identical&nbsp;to&nbsp;the&nbsp;current&nbsp;one&nbsp;[*]<br>
517<a href="#socket-fileno">fileno</a>()&nbsp;--&nbsp;return&nbsp;underlying&nbsp;file&nbsp;descriptor<br>
518<a href="#socket-getpeername">getpeername</a>()&nbsp;--&nbsp;return&nbsp;remote&nbsp;address&nbsp;[*]<br>
519<a href="#socket-getsockname">getsockname</a>()&nbsp;--&nbsp;return&nbsp;local&nbsp;address<br>
520<a href="#socket-getsockopt">getsockopt</a>(level,&nbsp;optname[,&nbsp;buflen])&nbsp;--&nbsp;get&nbsp;<a href="#socket">socket</a>&nbsp;options<br>
521<a href="#socket-gettimeout">gettimeout</a>()&nbsp;--&nbsp;return&nbsp;<a href="#timeout">timeout</a>&nbsp;or&nbsp;None<br>
522<a href="#socket-listen">listen</a>(n)&nbsp;--&nbsp;start&nbsp;listening&nbsp;for&nbsp;incoming&nbsp;connections<br>
523<a href="#socket-makefile">makefile</a>([mode,&nbsp;[bufsize]])&nbsp;--&nbsp;return&nbsp;a&nbsp;file&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;for&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;[*]<br>
524<a href="#socket-recv">recv</a>(buflen[,&nbsp;flags])&nbsp;--&nbsp;receive&nbsp;data<br>
525<a href="#socket-recv_into">recv_into</a>(buffer[,&nbsp;nbytes[,&nbsp;flags]])&nbsp;--&nbsp;receive&nbsp;data&nbsp;(into&nbsp;a&nbsp;buffer)<br>
526<a href="#socket-recvfrom">recvfrom</a>(buflen[,&nbsp;flags])&nbsp;--&nbsp;receive&nbsp;data&nbsp;and&nbsp;sender's&nbsp;address<br>
527<a href="#socket-recvfrom_into">recvfrom_into</a>(buffer[,&nbsp;nbytes,&nbsp;[,&nbsp;flags])<br>
528&nbsp;&nbsp;--&nbsp;receive&nbsp;data&nbsp;and&nbsp;sender's&nbsp;address&nbsp;(into&nbsp;a&nbsp;buffer)<br>
529<a href="#socket-sendall">sendall</a>(data[,&nbsp;flags])&nbsp;--&nbsp;send&nbsp;all&nbsp;data<br>
530<a href="#socket-send">send</a>(data[,&nbsp;flags])&nbsp;--&nbsp;send&nbsp;data,&nbsp;may&nbsp;not&nbsp;send&nbsp;all&nbsp;of&nbsp;it<br>
531<a href="#socket-sendto">sendto</a>(data[,&nbsp;flags],&nbsp;addr)&nbsp;--&nbsp;send&nbsp;data&nbsp;to&nbsp;a&nbsp;given&nbsp;address<br>
532<a href="#socket-setblocking">setblocking</a>(0&nbsp;|&nbsp;1)&nbsp;--&nbsp;set&nbsp;or&nbsp;clear&nbsp;the&nbsp;blocking&nbsp;I/O&nbsp;flag<br>
533<a href="#socket-setsockopt">setsockopt</a>(level,&nbsp;optname,&nbsp;value)&nbsp;--&nbsp;set&nbsp;<a href="#socket">socket</a>&nbsp;options<br>
534<a href="#socket-settimeout">settimeout</a>(None&nbsp;|&nbsp;float)&nbsp;--&nbsp;set&nbsp;or&nbsp;clear&nbsp;the&nbsp;<a href="#timeout">timeout</a><br>
535<a href="#socket-shutdown">shutdown</a>(how)&nbsp;--&nbsp;shut&nbsp;down&nbsp;traffic&nbsp;in&nbsp;one&nbsp;or&nbsp;both&nbsp;directions<br>
536&nbsp;<br>
537&nbsp;[*]&nbsp;not&nbsp;available&nbsp;on&nbsp;all&nbsp;platforms!<br>&nbsp;</tt></td></tr>
538<tr><td>&nbsp;</td>
539<td width="100%">Methods defined here:<br>
540<dl><dt><a name="_socketobject-__init__"><strong>__init__</strong></a>(self, family<font color="#909090">=2</font>, type<font color="#909090">=1</font>, proto<font color="#909090">=0</font>, _sock<font color="#909090">=None</font>)</dt></dl>
541
542<dl><dt><a name="_socketobject-accept"><strong>accept</strong></a>(self)</dt><dd><tt><a href="#socket-accept">accept</a>()&nbsp;-&gt;&nbsp;(<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;address&nbsp;info)<br>
543&nbsp;<br>
544Wait&nbsp;for&nbsp;an&nbsp;incoming&nbsp;connection.&nbsp;&nbsp;Return&nbsp;a&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;representing&nbsp;the<br>
545connection,&nbsp;and&nbsp;the&nbsp;address&nbsp;of&nbsp;the&nbsp;client.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address<br>
546info&nbsp;is&nbsp;a&nbsp;pair&nbsp;(hostaddr,&nbsp;port).</tt></dd></dl>
547
548<dl><dt><a name="_socketobject-bind"><strong>bind</strong></a>(...)</dt><dd><tt><a href="#socket-bind">bind</a>(address)<br>
549&nbsp;<br>
550Bind&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;a&nbsp;local&nbsp;address.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address&nbsp;is&nbsp;a<br>
551pair&nbsp;(host,&nbsp;port);&nbsp;the&nbsp;host&nbsp;must&nbsp;refer&nbsp;to&nbsp;the&nbsp;local&nbsp;host.&nbsp;For&nbsp;raw&nbsp;packet<br>
552sockets&nbsp;the&nbsp;address&nbsp;is&nbsp;a&nbsp;tuple&nbsp;(ifname,&nbsp;proto&nbsp;[,pkttype&nbsp;[,hatype]])</tt></dd></dl>
553
554<dl><dt><a name="_socketobject-close"><strong>close</strong></a>(self, _closedsocket<font color="#909090">=&lt;class 'socket._closedsocket'&gt;</font>, _delegate_methods<font color="#909090">=('recv', 'recvfrom', 'recv_into', 'recvfrom_into', 'send', 'sendto')</font>, setattr<font color="#909090">=&lt;built-in function setattr&gt;</font>)</dt><dd><tt><a href="#socket-close">close</a>()<br>
555&nbsp;<br>
556Close&nbsp;the&nbsp;<a href="#socket">socket</a>.&nbsp;&nbsp;It&nbsp;cannot&nbsp;be&nbsp;used&nbsp;after&nbsp;this&nbsp;call.</tt></dd></dl>
557
558<dl><dt><a name="_socketobject-connect"><strong>connect</strong></a>(...)</dt><dd><tt><a href="#socket-connect">connect</a>(address)<br>
559&nbsp;<br>
560Connect&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;a&nbsp;remote&nbsp;address.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address<br>
561is&nbsp;a&nbsp;pair&nbsp;(host,&nbsp;port).</tt></dd></dl>
562
563<dl><dt><a name="_socketobject-connect_ex"><strong>connect_ex</strong></a>(...)</dt><dd><tt><a href="#socket-connect_ex">connect_ex</a>(address)&nbsp;-&gt;&nbsp;errno<br>
564&nbsp;<br>
565This&nbsp;is&nbsp;like&nbsp;<a href="#socket-connect">connect</a>(address),&nbsp;but&nbsp;returns&nbsp;an&nbsp;<a href="#error">error</a>&nbsp;code&nbsp;(the&nbsp;errno&nbsp;value)<br>
566instead&nbsp;of&nbsp;raising&nbsp;an&nbsp;exception&nbsp;when&nbsp;an&nbsp;<a href="#error">error</a>&nbsp;occurs.</tt></dd></dl>
567
568<dl><dt><a name="_socketobject-dup"><strong>dup</strong></a>(self)</dt><dd><tt><a href="#socket-dup">dup</a>()&nbsp;-&gt;&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a><br>
569&nbsp;<br>
570Return&nbsp;a&nbsp;new&nbsp;<a href="#socket">socket</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;connected&nbsp;to&nbsp;the&nbsp;same&nbsp;system&nbsp;resource.</tt></dd></dl>
571
572<dl><dt><a name="_socketobject-fileno"><strong>fileno</strong></a>(...)</dt><dd><tt><a href="#socket-fileno">fileno</a>()&nbsp;-&gt;&nbsp;integer<br>
573&nbsp;<br>
574Return&nbsp;the&nbsp;integer&nbsp;file&nbsp;descriptor&nbsp;of&nbsp;the&nbsp;<a href="#socket">socket</a>.</tt></dd></dl>
575
576<dl><dt><a name="_socketobject-getpeername"><strong>getpeername</strong></a>(...)</dt><dd><tt><a href="#socket-getpeername">getpeername</a>()&nbsp;-&gt;&nbsp;address&nbsp;info<br>
577&nbsp;<br>
578Return&nbsp;the&nbsp;address&nbsp;of&nbsp;the&nbsp;remote&nbsp;endpoint.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address<br>
579info&nbsp;is&nbsp;a&nbsp;pair&nbsp;(hostaddr,&nbsp;port).</tt></dd></dl>
580
581<dl><dt><a name="_socketobject-getsockname"><strong>getsockname</strong></a>(...)</dt><dd><tt><a href="#socket-getsockname">getsockname</a>()&nbsp;-&gt;&nbsp;address&nbsp;info<br>
582&nbsp;<br>
583Return&nbsp;the&nbsp;address&nbsp;of&nbsp;the&nbsp;local&nbsp;endpoint.&nbsp;&nbsp;For&nbsp;IP&nbsp;sockets,&nbsp;the&nbsp;address<br>
584info&nbsp;is&nbsp;a&nbsp;pair&nbsp;(hostaddr,&nbsp;port).</tt></dd></dl>
585
586<dl><dt><a name="_socketobject-getsockopt"><strong>getsockopt</strong></a>(...)</dt><dd><tt><a href="#socket-getsockopt">getsockopt</a>(level,&nbsp;option[,&nbsp;buffersize])&nbsp;-&gt;&nbsp;value<br>
587&nbsp;<br>
588Get&nbsp;a&nbsp;<a href="#socket">socket</a>&nbsp;option.&nbsp;&nbsp;See&nbsp;the&nbsp;Unix&nbsp;manual&nbsp;for&nbsp;level&nbsp;and&nbsp;option.<br>
589If&nbsp;a&nbsp;nonzero&nbsp;buffersize&nbsp;argument&nbsp;is&nbsp;given,&nbsp;the&nbsp;return&nbsp;value&nbsp;is&nbsp;a<br>
590string&nbsp;of&nbsp;that&nbsp;length;&nbsp;otherwise&nbsp;it&nbsp;is&nbsp;an&nbsp;integer.</tt></dd></dl>
591
592<dl><dt><a name="_socketobject-gettimeout"><strong>gettimeout</strong></a>(...)</dt><dd><tt><a href="#socket-gettimeout">gettimeout</a>()&nbsp;-&gt;&nbsp;<a href="#timeout">timeout</a><br>
593&nbsp;<br>
594Returns&nbsp;the&nbsp;<a href="#timeout">timeout</a>&nbsp;in&nbsp;seconds&nbsp;(float)&nbsp;associated&nbsp;with&nbsp;<a href="#socket">socket</a>&nbsp;<br>
595operations.&nbsp;A&nbsp;<a href="#timeout">timeout</a>&nbsp;of&nbsp;None&nbsp;indicates&nbsp;that&nbsp;timeouts&nbsp;on&nbsp;<a href="#socket">socket</a>&nbsp;<br>
596operations&nbsp;are&nbsp;disabled.</tt></dd></dl>
597
598<dl><dt><a name="_socketobject-listen"><strong>listen</strong></a>(...)</dt><dd><tt><a href="#socket-listen">listen</a>(backlog)<br>
599&nbsp;<br>
600Enable&nbsp;a&nbsp;server&nbsp;to&nbsp;accept&nbsp;connections.&nbsp;&nbsp;The&nbsp;backlog&nbsp;argument&nbsp;must&nbsp;be&nbsp;at<br>
601least&nbsp;0&nbsp;(if&nbsp;it&nbsp;is&nbsp;lower,&nbsp;it&nbsp;is&nbsp;set&nbsp;to&nbsp;0);&nbsp;it&nbsp;specifies&nbsp;the&nbsp;number&nbsp;of<br>
602unaccepted&nbsp;connections&nbsp;that&nbsp;the&nbsp;system&nbsp;will&nbsp;allow&nbsp;before&nbsp;refusing&nbsp;new<br>
603connections.</tt></dd></dl>
604
605<dl><dt><a name="_socketobject-makefile"><strong>makefile</strong></a>(self, mode<font color="#909090">='r'</font>, bufsize<font color="#909090">=-1</font>)</dt><dd><tt><a href="#socket-makefile">makefile</a>([mode[,&nbsp;bufsize]])&nbsp;-&gt;&nbsp;file&nbsp;<a href="__builtin__.html#object">object</a><br>
606&nbsp;<br>
607Return&nbsp;a&nbsp;regular&nbsp;file&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;corresponding&nbsp;to&nbsp;the&nbsp;<a href="#socket">socket</a>.&nbsp;&nbsp;The&nbsp;mode<br>
608and&nbsp;bufsize&nbsp;arguments&nbsp;are&nbsp;as&nbsp;for&nbsp;the&nbsp;built-in&nbsp;open()&nbsp;function.</tt></dd></dl>
609
610<dl><dt><a name="_socketobject-sendall"><strong>sendall</strong></a>(...)</dt><dd><tt><a href="#socket-sendall">sendall</a>(data[,&nbsp;flags])<br>
611&nbsp;<br>
612Send&nbsp;a&nbsp;data&nbsp;string&nbsp;to&nbsp;the&nbsp;<a href="#socket">socket</a>.&nbsp;&nbsp;For&nbsp;the&nbsp;optional&nbsp;flags<br>
613argument,&nbsp;see&nbsp;the&nbsp;Unix&nbsp;manual.&nbsp;&nbsp;This&nbsp;calls&nbsp;<a href="#socket-send">send</a>()&nbsp;repeatedly<br>
614until&nbsp;all&nbsp;data&nbsp;is&nbsp;sent.&nbsp;&nbsp;If&nbsp;an&nbsp;<a href="#error">error</a>&nbsp;occurs,&nbsp;it's&nbsp;impossible<br>
615to&nbsp;tell&nbsp;how&nbsp;much&nbsp;data&nbsp;has&nbsp;been&nbsp;sent.</tt></dd></dl>
616
617<dl><dt><a name="_socketobject-setblocking"><strong>setblocking</strong></a>(...)</dt><dd><tt><a href="#socket-setblocking">setblocking</a>(flag)<br>
618&nbsp;<br>
619Set&nbsp;the&nbsp;<a href="#socket">socket</a>&nbsp;to&nbsp;blocking&nbsp;(flag&nbsp;is&nbsp;true)&nbsp;or&nbsp;non-blocking&nbsp;(false).<br>
620<a href="#socket-setblocking">setblocking</a>(True)&nbsp;is&nbsp;equivalent&nbsp;to&nbsp;<a href="#socket-settimeout">settimeout</a>(None);<br>
621<a href="#socket-setblocking">setblocking</a>(False)&nbsp;is&nbsp;equivalent&nbsp;to&nbsp;<a href="#socket-settimeout">settimeout</a>(0.0).</tt></dd></dl>
622
623<dl><dt><a name="_socketobject-setsockopt"><strong>setsockopt</strong></a>(...)</dt><dd><tt><a href="#socket-setsockopt">setsockopt</a>(level,&nbsp;option,&nbsp;value)<br>
624&nbsp;<br>
625Set&nbsp;a&nbsp;<a href="#socket">socket</a>&nbsp;option.&nbsp;&nbsp;See&nbsp;the&nbsp;Unix&nbsp;manual&nbsp;for&nbsp;level&nbsp;and&nbsp;option.<br>
626The&nbsp;value&nbsp;argument&nbsp;can&nbsp;either&nbsp;be&nbsp;an&nbsp;integer&nbsp;or&nbsp;a&nbsp;string.</tt></dd></dl>
627
628<dl><dt><a name="_socketobject-settimeout"><strong>settimeout</strong></a>(...)</dt><dd><tt><a href="#socket-settimeout">settimeout</a>(<a href="#timeout">timeout</a>)<br>
629&nbsp;<br>
630Set&nbsp;a&nbsp…

Large files files are truncated, but you can click here to view the full file