MCPcopy Create free account
hub / github.com/pyload/pyload / close

Method close

module/lib/wsgiserver/__init__.py:1207–1226  ·  view source on GitHub ↗

Close the socket underlying this connection.

(self)

Source from the content-addressed store, hash-verified

1205 linger = False
1206
1207 def close(self):
1208 """Close the socket underlying this connection."""
1209 self.rfile.close()
1210
1211 if not self.linger:
1212 # Python's socket module does NOT call close on the kernel socket
1213 # when you call socket.close(). We do so manually here because we
1214 # want this server to send a FIN TCP segment immediately. Note this
1215 # must be called *before* calling socket.close(), because the latter
1216 # drops its reference to the kernel socket.
1217 self.socket._sock.close()
1218 self.socket.close()
1219 else:
1220 # On the other hand, sometimes we want to hang around for a bit
1221 # to make sure the client has a chance to read our entire
1222 # response. Skipping the close() calls here delays the FIN
1223 # packet until the socket object is garbage-collected later.
1224 # Someday, perhaps, we'll do the full lingering_close that
1225 # Apache does, but not today.
1226 pass
1227
1228
1229def format_exc(limit=None):

Callers 5

closeMethod · 0.45
_respondMethod · 0.45
runMethod · 0.45
startMethod · 0.45
stopMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected