UDP socket file transfer python 3.5
<p>How do i transfer a large file (video,audio) from my client to server in the local host using UDP sockets in python 3.5? I was able to send a small .txt file but not other file types. Please give me suggestions. 
Thank you! </p>

<p>Here is my code to transfer a text file.</p>

<p>CLIENT CODE:</p>

<pre><code>import socket
import sys

s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)

host = '127.0.0.1'
port=6000

msg="Trial msg"

msg=msg.encode('utf-8')

while 1:

    s.sendto(msg,(host,port))
    data, servaddr = s.recvfrom(1024)
    data=data.decode('utf-8')
    print("Server reply:", data)
    break
s.settimeout(5)   

filehandle=open("testing.txt","rb")

finalmsg=filehandle.read(1024)

s.sendto(finalmsg, (host,port))
</code></pre>

<p>SERVER CODE:</p>

<pre><code>import socket

host='127.0.0.1'

port=6000

s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)

s.bind(("",port))

print("waiting on port:", port)

while 1:

    data, clientaddr= s.recvfrom(1024)
    data=data.decode('utf-8')
    print(data)
    s.settimeout(4)
    break

reply="Got it thanks!"

reply=reply.encode('utf-8')

s.sendto(reply,clientaddr)

clientmsg, clientaddr=s.recvfrom(1024)
</code></pre>