def close_send_socket(self):
try:
# Check if we're going to use the AT command version of sockets or the
# native Python socket lib.
if self.__to_use_at_sockets():
self.network.close_socket()
else:
try:
self.sock.shutdown(socket.SHUT_RDWR)
except socket.error:
pass
self.sock.close()
self._is_send_socket_open = False
self.logger.info('Socket closed.')
except (IOError):
self.logger.error('An error occurred while attempting to send the message to the cloud')
self.logger.error('Please try again.')
# EFFECTS: Receives data from inbound socket.
评论列表
文章目录