def save_send(socket, data):
 while (len(data) > 0):
  try:
   send_data_size = socket.send(data)
   data = data[send_data_size:]
  except error as msg:
   sleep(0.01)

def save_send ( socket , data ) : while ( len ( data ) > 0 ) : try : send_data_size = socket . send ( data ) data = data [ send_data_size : ] except error as msg : sleep ( 0.01 )
send data to a socket .