sock.setblocking(1) self.send_remote_cmd(self.bc_sock, relay.FORWARD_CONNECTION_SUCCESS, self.establishing_dict[sock]) del self.establishing_dict[sock] self.input_list.append(sock) self.set_channel(sock, channel_id) for self.selected_input_socket in inputready: if self.selected_input_socket == self.bc_sock: try: self.manage_remote_socket(self.bc_sock) except relay.RelayError: logger.debug('Remote side closed socket') relay.close_sockets(self.input_list) return else: self.manage_forward_socket(self.selected_input_socket) def handle_remote_cmd(self, data): cmd = data[0] logger.debug('Received cmd data from remote side. Cmd: {0}'.format( relay.cmd_names[cmd])) if cmd == relay.CHANNEL_CLOSE_CMD: channel_id = unpack('<H', data[1:3])[0] logger.debug( 'Channel close request with id: {0}'.format(channel_id)) establishing_sock = key_by_value(self.establishing_dict, channel_id) if establishing_sock is not None:
def shutdown(self): self.remote_side_down = True relay.close_sockets(self.input_list) sys.exit(1)
def shutdown(self): relay.close_sockets(self.input_list) self.remote_side_down = True