You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, so I've been trying to code a file transfer program in python and it worked preety well on my pc (for now I only tested it with a txt file but I think it'll work with other files too), but the problem is when I tried running it on my brothers pc WinError 10061 popped up, I've done quite a bit of research before writing this and the common running the server before the client method doesn't work on my pc, I also tried turning off my antivirus thinking it blocked it but that didn't do anything either.
I don't really know what to do anymore so I came looking for help here. I hope somebody can help me
Here is the server program code:
import socket
s = socket.socket()
host = socket.gethostname()
port = 8080
s.bind((host,port))
s.listen(1)
print(host)
print("Waitning for any incoming connections ...")
conn, addr = s.accept()
print(addr, "Has connected to the server")
filename = input(str("Please enter the filename of the file : "))
file = open(filename , 'rb')
file_data = file.read(1024)
conn.send(file_data)
print("Data has been transmitted successfully")
And here is the client program code:
import socket
s = socket.socket()
host = input(str("Please enter the host adress of the sender : "))
port = 8080
s.connect((host,port))
print("Connected ... ")
filename = input(str("Please enter a filename for the incoming file : "))
file = open(filename, 'wb')
file_data = s.recv(1024)
file.write(file_data)
file.close()
print("File has been received successfully")
The text was updated successfully, but these errors were encountered:
I think issue is with windows firewall or program not being run as admin due to UAC. Try using another port, like 30155 or something other high enough (max port number is 65536)
does this error pops out on the server side of the app or on client-side?
Hi, so I've been trying to code a file transfer program in python and it worked preety well on my pc (for now I only tested it with a txt file but I think it'll work with other files too), but the problem is when I tried running it on my brothers pc WinError 10061 popped up, I've done quite a bit of research before writing this and the common running the server before the client method doesn't work on my pc, I also tried turning off my antivirus thinking it blocked it but that didn't do anything either.
I don't really know what to do anymore so I came looking for help here. I hope somebody can help me
Here is the server program code:
import socket
s = socket.socket()
host = socket.gethostname()
port = 8080
s.bind((host,port))
s.listen(1)
print(host)
print("Waitning for any incoming connections ...")
conn, addr = s.accept()
print(addr, "Has connected to the server")
filename = input(str("Please enter the filename of the file : "))
file = open(filename , 'rb')
file_data = file.read(1024)
conn.send(file_data)
print("Data has been transmitted successfully")
And here is the client program code:
import socket
s = socket.socket()
host = input(str("Please enter the host adress of the sender : "))
port = 8080
s.connect((host,port))
print("Connected ... ")
filename = input(str("Please enter a filename for the incoming file : "))
file = open(filename, 'wb')
file_data = s.recv(1024)
file.write(file_data)
file.close()
print("File has been received successfully")
The text was updated successfully, but these errors were encountered: