#๐ TCP client to send multiple files
7 messages ยท Page 1 of 1 (latest)
@small dune
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
You compute str(file_count).encode(FORMAT) twice. I found myself reading both to check.
You could do with a send_data function which sends the header and the data together, to save separately sending the header and data every time.
What if the length of the data exceeds the size of the header? eg >10GB of data, needing 11 characters to express the size.
Thank you for review my code, after inspection i did find computing str(file_count).encode(FORMAT) is rather wasteful and annoying to read, and so i did make a send_data function and simply encode the data once. About the question of insufficient header size, I doubt utf-8 files can go up to 10 GB per file so i went with 10
Also odd is that when i review my doc i said pictures despite the format being utf-8, I renewed the pastebin link also.
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.