Question

In: Computer Science

Could you give me some solving about the following question? question 1 Design a pair of...

Could you give me some solving about the following question?

question 1 Design a pair of UDP  based large file transmission programs using python. Transmitted file size should be over 100mb, Limitations: only os, socket, struct, hashlib, math, tqdm, File check is required after transmission

Solutions

Expert Solution

Splitting the text file into chunks of data would help to send large amounts of data.

Client:

import socket as s
sckt=s.socket(s.AF_INET, s.SOCK_DGRAM)
serv_addr=(SERVER_ADDRESS, APP_PORT)
file_name='LargeFile.txt'
f=open(filename,'r')
word=""
while 1:
   ch = f.read(1)
   if not ch:
       sckt.sendto(word,serv_addr)
       break
   elif len(word<=1024):  
       word=word+ch
   else:
       sckt.sendto(word,serv_addr)
       word=""
f.close()

Server:

import socket as s
servsckt=s.socket(s.AF_INET, s.SOCK_STREAM)
servsckt.bind((SERVER_ADDRESS, APP_PORT))
f=open(output.txt,'')
while True:
   word, addr = servsckt.recvfrom(1024)
   f.write(word)
f.close()

A char to char file comparison can be written for checking the contents of file


Related Solutions

Question about IQR(Interquartile Range) 1) could you please give some vivid example to explain what is...
Question about IQR(Interquartile Range) 1) could you please give some vivid example to explain what is IQR? like in what circumstance we use it and how to use it? 2) what's the difference and connection between quantile and quartile? Thanks a lot
Please give me some idea about this blog question: It is important to understand and analyze...
Please give me some idea about this blog question: It is important to understand and analyze a country’s political system before entering that market. Is it more important for a political system to be stable, or is it more important for it to be transparent?
Could you give me a basic introduction about “Validation of Reynolds analogy concept “ ?
Could you give me a basic introduction about “Validation of Reynolds analogy concept “ ?
Could you give me some tips on how to know how to identify chiral centers in...
Could you give me some tips on how to know how to identify chiral centers in a large molecule? I know that a chiral center is surrounded by 4 different groups...but I'm finding it a little bit hard to recognize multiple chiral center in large structures.
Please give me some idea blog entry about 3 paragraphs addressing the following question: Stakeholder theory...
Please give me some idea blog entry about 3 paragraphs addressing the following question: Stakeholder theory and shareholder (ownership) theory are important concepts that explain the obligations and purpose of a business. Which of these theories is most valid in your opinion? Explain why and provide an example to support your argument. Do not spend time defining each theory. Spend your time analyzing, comparing and illustrating the concepts
I have several question regarding axion. Could anyone give me some brief introduction to what is...
I have several question regarding axion. Could anyone give me some brief introduction to what is a axion string, axion field and how is this related to fermion zero mode and chiral zero mode?
I am trying to create a PICO question research question. Can you please give me some...
I am trying to create a PICO question research question. Can you please give me some examples that i can use? At least 3 PICO questions and their research question and what do you want to find out about the issue. Thank you
If someone could give me some ideas to discuss, that would be great! Particularly anyting to...
If someone could give me some ideas to discuss, that would be great! Particularly anyting to do with access. Introduction The internal auditor of Missouri State University was in a quandary. Several retail items from a major supplier were on clearance; and the paper trail led to a check from the supplier that had not been cashed (in situations where merchandise is on clearance the supplier often provides a check to help offset the loss to the bookstore). The auditor...
Could some give a deep descripition about the power factor. 1. How the power factor will...
Could some give a deep descripition about the power factor. 1. How the power factor will be less? 2.What should we do inorder to increase the power factor? 3.How do we maintain a good power factor in a 3 phase motor without using the capacitor?
1) Design a set of 6 base pair long primers that scientists could use to amplify...
1) Design a set of 6 base pair long primers that scientists could use to amplify the entire sequence of the gene in Q11 from the coronavirus genome. Be sure to label the 5' and 3' ends of your primers! 2) Unverricht-Lundborg disease is caused by an increased number of copies (expansion) of the dodecamer repeat in the CSTB gene on chromosome 21. Most people with this disorder have more than 30 repeats of the dodecamer sequence in both copies...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT