aioquic
aioquic copied to clipboard
Issue with Connection migration while downloading file using example Client and Server
Hai @jlaine
Thank you for your contribution.
I am trying to download a file using client and server from examples folder.I was able to download file correctly. But whenever i have made some small change to client which will do connection migration in middle using multi-threading i was unable to continue the file download correctly and file was unable to download after connection migration.
Here is the code which i have made change
)
method = "POST"
else:
async def conn_mig():
print("sleep start")
await asyncio.sleep(4)
print("sleep done")
client._transport.close()
loop = asyncio.get_event_loop()
#await loop.create_datagram_endpoint(lambda: client, local_addr=("::ffff:172.16.2.3", 4423), remote_addr=("::ffff:172.16.2.1",4433))
await loop.create_datagram_endpoint(lambda: client, local_addr=("::", 0))
#client.change_connection_id()
import threading
print(threading.current_thread().name)
print(threading.get_ident())
def send_thread():
asyncio.run(conn_mig())
def start_thread():
import threading
x = threading.Thread(target=send_thread)
x.start()
start_thread()
import threading
print(threading.current_thread().name)
print(threading.get_ident())
http_events = await client.get(url)
method = "GET"
elapsed = time.time() - start
# print speed
octets = 0
for http_event in http_events:
I am unable to get what is the issue and could you please help me to sort out this issue @jlaine
Am i missing anything or Do i need to make changes on the server side too.
Looking forward for reply
Thank you.
Can we have a reproduction without threading, it's really unusual to use multi-threading in an asyncio project.
Hai @jlaine
Thank you for replying back.
When I tried without multi-threading,then connection migration is successful happening just before start of file download or just after file download but not in the middle of file download.
Tried to do connection migration without multi threading in the middle of file download but it was not working.
Could you please suggest me any alternative way to do connection migration in the middle of file download without multi threading.
Looking forward for your reply.
Thank you.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.