in resources/code/my-first-enclave/secure-local-channel/server.py [0:0]
def recv_data(self):
# Receive data from a remote endpoint
while True:
try:
print("Let's accept stuff")
(from_client, (remote_cid, remote_port)) = self.sock.accept()
print("Connection from " + str(from_client) + str(remote_cid) + str(remote_port))
query = from_client.recv(1024).decode()
print("Message received: " + query)
# Call the external URL
# for our scenario we will download list of published ip ranges and return list of S3 ranges for porvided region.
response = get_s3_ip_by_region(query)
# Send back the response
from_client.send(str(response).encode())
from_client.close()
print("Client call closed")
except Exception as ex:
print(ex)