Please login or register.

Login with username, password and session length
gfx gfx
76745 Posts in 13488 Topics by 1647 Members - Latest Member: rahbun December 05, 2023, 02:34:45 pm
WinMX World :: Forum  |  Technical  |  WinMX Client  |  a ? in transfer routine

Author Topic: a ? in transfer routine  (Read 4638 times)

0 Members and 1 Guest are viewing this topic.

Offline Forested665

  • Forum Member
  • Linux:2003 FreeBSD:2004 Debian/BSD developer:2006
a ? in transfer routine
« on: February 28, 2009, 05:03:43 am »
what i gather from this is.                    its from winpy btw
(assuming the info reffered to in tmp is the file name of something you are downloading)
1)receive the file
2)if it is not the file then close the connection.
if the local file is smaller then the file then continue to receive file. (this is like resuming an incomplete download right?)
4) if there is an error close the download sequence.
##now comes the part thats really confused me
5)if there is an error in the socket connection and the completed size and buffer are false
6)write a header
7)control the download function
8)if the completed size and buffer are true stop the download process

Code: [Select]
            tmp = self.socket.recv(_len-len(self.ibuf)); self.ibuf += tmp
            if not tmp: self.close()
            if len(self.ibuf) < _len: return

        except socket.error:

            if cmp(str(self.Size), self.ibuf) == 0:
                head = BlockHeader(0, 2040)
                self.write( struct.pack("<I", head.start) )
                self.write( struct.pack("<I", head.end) )               
                self.handle_event = self.Downloading
                self.ibuf = ""
if anyone is able to clarify this please do so.

and another question about python that should be relatively easy to answer.
how was string going to add primary to this client without violating the GPL that he licensed it under?
BSD -  The Daemons Are No Longer Just Inside My Head.

Offline GhostShip

  • Ret. WinMX Special Forces
  • WMW Team
  • *****
Re: a ? in transfer routine
« Reply #1 on: February 28, 2009, 10:28:53 am »
The author decides the licencing conditions Bacon and is not bound by the users half of the agreement just his own which is to allow a user to have access to his program and src for that particular release.

As to your query the code makes more sense than your words do, lol

The next section of the code deals with grabbing a chunk of data and thus that requires the start and finish positions of the chunk, the chunk size is usually given as around 4k, others networks use 32k at this stage so there is scope for tweaking here, also a further hurdle for programers is the send M marker that often causes confusion, however I wont go into a big old yawn here about when and where its required as this really falls inside the scope of the core section, however I will help you by providing specific answer to specific questions sent in PM and I,m very pleased to see you taking an interest in such matters .


WinMX World :: Forum  |  Technical  |  WinMX Client  |  a ? in transfer routine

©2005-2023 All Rights Reserved.
SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
Page created in 0.019 seconds with 22 queries.
Helios Multi © Bloc
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!