3
votes

So, I've got a program consisting of two processes, that are often running on different machines. One is a display server, the other a controller. Right now they communicate using UDP Datagram sockets, since a missed packet only means a skipped frame, and TCP sockets are too slow. These computers know each others' IP addresses and know ports they're using for UDP communications.

I'm looking for an easy-to-use way to transfer files from one to the other in Python. I'm on Windows 7, so if the solution is windows specific that's acceptable. I just don't want things to get too messy with opening a bunch of different ports and using UDP and TCP sockets at the same time, but if that's they only way to do it, that's okay.

I've looked a bit at the ActiveState recipe netcopy: http://code.activestate.com/recipes/442521-windows-network-file-transfers/ It works well, but knowing what location to send the file to and obtaining the permissions to send it there has been tricky so far, so this is looking like not the kind of solution I want.

I'm open to crazy/unique ideas. Also, I'm fairly new to network programming, so if I'm using any terminology wrong, I apologize.

2

2 Answers

2
votes

I would not use UDP for file transfer, period. It would be less complex to open TCP sockets on each end and roll your own file transfer protocol on top of it than to implement reliable transfer on top of UDP.

Some management of filenames and permissions will be required if you really need to have a file at both ends. You could blow it off if the download end only needed the file contents and not an actual file in the filesystem.

1
votes