gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
76774 Posts in 13500 Topics by 1651 Members - Latest Member: insider4ever March 29, 2024, 01:29:10 am
*
gfx*gfx
gfx
WinMX World :: Forum  |  Technical  |  WinMX Client  |  a ? in transfer routine
gfx
gfxgfx
 

Author Topic: a ? in transfer routine  (Read 4690 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]
try:
            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:
            self.close()

        else:
           
            if cmp(str(self.Size), self.ibuf) == 0:
                head = BlockHeader(0, 2040)
                self.blockheaders.append(head)
                self.write( struct.pack("<I", head.start) )
                self.write( struct.pack("<I", head.end) )               
                self.handle_event = self.Downloading
                self.ibuf = ""
           
            else:
                self.close()
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
 

gfxgfx
gfx
©2005-2024 WinMXWorld.com. All Rights Reserved.
SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
Page created in 0.017 seconds with 21 queries.
Helios Multi © Bloc
gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!