Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

FTP or SOCKET server in python???

Name: Fox64 2007-01-12 12:31

so i was sittin there one night, with actual free time on my hands, and I decided it was time to incorporate some python code into my renders in Blender. I want to form connections and create arrays and have all sorts of good connection fun with another computer. I need something to transfer strings and also data. The problems are that I need a protocol that is fast and reliable ( also simplistic ), and the protocol has to be able to handle files well.
I would pick FTP over SOCKET anyday for file transfer, but as for raw data involving variables, I think a SOCKET server could do an adiquate job. OR maybe I'm mistaken and the connection of sockets may take forever, and there might be something more suitable...
So my question is: FTP or SOCKET?
Or do I have to use both?

Name: Anonymous 2007-04-23 15:56 ID:XE7DCiMQ


    def start(self):
        """Opens a TCP socket"""
        #Create socket
        self.tcp_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.log.verbose("TCP server socket opened")
       
        #Bind socket to hostname:port
        self.tcp_server.bind( (self.settings["Hostname"], self.settings["Port"]) )
        self.log.verbose("TCP server socket bound to %s:%s"%(self.settings["Hostname"],
                                                             self.settings["Port"]))
       
        #Start listening to socket, only accept one connection
        self.tcp_server.listen(1)


Sockets is the shit! Also, I wrote this code, therefore I am cool. Also, the code needs more "try/catch" to be safe, but I'm only using this program myself, so I can't be assed with that.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List