Close the connection to the HTTP server.
(self)
| 1037 | self._tunnel() |
| 1038 | |
| 1039 | def close(self): |
| 1040 | """Close the connection to the HTTP server.""" |
| 1041 | self.__state = _CS_IDLE |
| 1042 | try: |
| 1043 | sock = self.sock |
| 1044 | if sock: |
| 1045 | self.sock = None |
| 1046 | sock.close() # close it manually... there may be other refs |
| 1047 | finally: |
| 1048 | response = self.__response |
| 1049 | if response: |
| 1050 | self.__response = None |
| 1051 | response.close() |
| 1052 | |
| 1053 | def send(self, data): |
| 1054 | """Send 'data' to the server. |