Gnutella Forums  

Go Back   Gnutella Forums > Gnutella News and Gnutelliums Forums > General Gnutella Development Discussion
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

General Gnutella Development Discussion For general discussion about Gnutella development.


Welcome To Gnutella Forums

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, fun aspects such as the image caption contest and play in the arcade, and access many other special features after your registration and email confirmation. Registration is fast, simple and absolutely free so please, join our community today! (click here) (Note: we use Yandex mail server so make sure yandex is not on your email filter or blocklist.)

If you have any problems with the Gnutella Forum registration process or your Gnutella Forum account login, please contact us (this is not for program use questions.) Your email address must be legitimate and verified before becoming a full member of the forums. Please be sure to disable any spam filters you may have for our website, so that email messages can reach you.
Note: Any other issue with registration, etc., send a Personal Message (PM) to one of the active Administrators: Lord of the Rings or Birdy.

Once registered but before posting, members MUST READ the FORUM RULES (click here) and members should include System details - help us to help you (click on blue link) in their posts if their problem relates to using the program. Whilst forum helpers are happy to help where they can, without these system details your post might be ignored. And wise to read How to create a New Thread

Thank you

If you are a Spammer click here.
This is not a business advertising forum, all member profiles with business advertising will be banned, all their posts removed. Spamming is illegal in many countries of the world. Guests and search engines cannot view member profiles.



           Deutsch?              Español?                  Français?                   Nederlands?
   Hilfe in Deutsch,   Ayuda en español,   Aide en français et LimeWire en françaisHulp in het Nederlands

Forum Rules

Support Forums

Before you post to one of the specific Client Help and Support Conferences in Gnutella Client Forums please look through other threads and Stickies that may answer your questions. Most problems are not new. The Search function is most useful. Also the red Stickies have answers to the most commonly asked questions. (over 90 percent).
If your problem is not resolved by a search of the forums, please take the next step and post in the appropriate forum. There are many members who will be glad to help.
If you are new to the world of file sharing please do not be shy! Everyone was ‘new’ when they first started.

When posting, please include details for:
Your Operating System ....... Your version of your Gnutella Client (* this is important for helping solve problems) ....... Your Internet connection (56K, Cable, DSL) ....... The exact error message, if one pops up
Any other relevant information that you think may help ....... Try to make your post descriptive, specific, and clear so members can quickly and efficiently help you. To aid helpers in solving download/upload problems, LimeWire and Frostwire users must specify whether they are downloading a torrent file or a file from the Gnutella network.
Members need to supply these details >>> System details - help us to help you (click on blue link)


Moderators

There are senior members on the forums who serve as Moderators. These volunteers keep the board organized and moving.
Moderators are authorized to: (in order of increasing severity)
Move posts to the correct forums. Many times, members post in the wrong forum. These off-topic posts may impede the normal operation of the forum.
Edit posts. Moderators will edit posts that are offensive or break any of the House Rules.
Delete posts. Posts that cannot be edited to comply with the House Rules will be deleted.
Restrict members. This is one of the last punishments before a member is banned. Restrictions may include placing all new posts in a moderation queue or temporarily banning the offender.
Ban members. The most severe punishment. Three or more moderators or administrators must agree to the ban for this action to occur. Banning is reserved for very severe offenses and members who, after many warnings, fail to comply with the House Rules. Banning is permanent. Bans cannot be removed by the moderators and probably won't be removed by the administration.


The Rules

1. Warez, copyright violation, or any other illegal activity may NOT be linked or expressed in any form. Topics discussing techniques for violating these laws and messages containing locations of web sites or other servers hosting illegal content will be silently removed. Multiple offenses will result in consequences. File names are not required to discuss your issues. If filenames are copyright then do not belong on these forums & will be edited out or post removed. Picture sample attachments in posts must not include copyright infringement.

2. Spamming and excessive advertising will not be tolerated. Commercial advertising is not allowed in any form, including using in signatures.

3. There will be no excessive use of profanity in any forum.

4. There will be no racial, ethnic, or gender based insults, or any other personal attacks.

5. Pictures may be attached to posts and signatures if they are not sexually explicit or offensive. Picture sample attachments in posts must not include copyright infringement.

6. Remember to post in the correct forum. Take your time to look at other threads and see where your post will go. If your post is placed in the wrong forum it will be moved by a moderator. There are specific Gnutella Client sections for LimeWire, Phex, FrostWire, BearShare, Gnucleus, Morpheus, and many more. Please choose the correct section for your problem.

7. If you see a post in the wrong forum or in violation of the House Rules, please contact a moderator via Private Message or the "Report this post to a moderator" link at the bottom of every post. Please do not respond directly to the member - a moderator will do what is required.

8. Any impersonation of a forum member in any mode of communication is strictly prohibited and will result in banning.

9. Multiple copies of the same post will not be tolerated. Post your question, comment, or complaint only once. There is no need to express yourself more than once. Duplicate posts will be deleted with little or no warning. Keep in mind a forum censor may temporarily automatically hold up your post, if you do not see your post, do not post again, it will be dealt with by a moderator within a reasonable time. Authors of multiple copies of same post may be dealt with by moderators within their discrete judgment at the time which may result in warning or infraction points, depending on severity as adjudged by the moderators online.

10. Posts should have descriptive topics. Vague titles such as "Help!", "Why?", and the like may not get enough attention to the contents.

11. Do not divulge anyone's personal information in the forum, not even your own. This includes e-mail addresses, IP addresses, age, house address, and any other distinguishing information. Don´t use eMail addresses in your nick. Reiterating, do not post your email address in posts. This is for your own protection.

12. Signatures may be used as long as they are not offensive or sexually explicit or used for commercial advertising. Commercial weblinks cannot be used under any circumstances and will result in an immediate ban.

13. Dual accounts are not allowed. Cannot explain this more simply. Attempts to set up dual accounts will most likely result in a banning of all forum accounts.

14. Video links may only be posted after you have a tally of two forum posts. Video link posting with less than a 2 post tally are considered as spam. Video link posting with less than a 2 post tally are considered as spam.

15. Failure to show that you have read the forum rules may result in forum rules breach infraction points or warnings awarded against you which may later total up to an automatic temporary or permanent ban. Supplying system details is a prerequisite in most cases, particularly with connection or installation issues.

Violation of any of these rules will bring consequences, determined on a case-by-case basis.


Thank You! Thanks for taking the time to read these forum guidelines. We hope your visit is helpful and mutually beneficial to the entire community.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old March 23rd, 2002
Gnutella Veteran
 
Join Date: March 14th, 2002
Location: Canada
Posts: 121
Smilin' Joe Fission is flying high
Question Need help with byte formats

Forgive my newbieness but I have a couple questions that I'm sure someone here can help me answer.

I'm a bit confused over some of this byte ordering stuff. I'm developing a servent of my own and this is probably the first application I've dealt with in which "big-endian" and "little-endian" byte formats have become an issue.

So, here's where my confusion starts. I've read the "Gnutella Protocol Specification v0.4" doc and early on there are 2 notes (in bold) that read: "Note 1: All fields in the following structures are in little-endian byte order unless otherwise specified." and "Note 2: All IP addresses in the following structures are in IPv4 format. For example, the IPv4 byte array: 0xD0, 0x11, 0x32, 0x04 represents the dotted address 208.17.50.4." OK, I can agree with that... no problem.

I suppose where I start to get confused is later on when the document goes into its description on the various packet formats. Along with the standard description of the IP address field on each packet, in bold it has a note stating "This field is in big-endian format." Does this mean I have to reverse the IP address before sending it out (ie. using the example given, the IP address would be essentially sent as 4.50.17.208)? Or is any conversion required for the IP field at all?

What about other numeric values like "Number of files shared" and "Number of Kilobytes shared" in a Pong packet for example? Do those need to be converted to big-endian as well? The reason I ask is that I downloaded some free code for a particular servent ("coyotella" written in Visual Basic) and in referring to that code, it seems that almost every numeric value is being converted to big-endian format before it's sent, which to me sounds wrong if I am to take "Note 1" (as it appears above) at its word.

Of course, I might be missing something along the way... might Winsock itself require the byte ordering to be reversed? (I think I read something somewhere that said that.) I'm just real confused right at the moment. Maybe I'm just reading too much into things. Then again, maybe I'm just slow. Hopefully one of you Gnutella gurus can help me out.

Any help is GREATLY appreciated.

Oh, and if it makes any difference, I'm developing my servent in Visual Basic 6.0.... ya ya, I know, funny laugh laugh... why don't I develop it in a REAL language? I dunno... "maybe later" is all I can say to that.

Thanks.

-SJF

Last edited by Smilin' Joe Fission; March 23rd, 2002 at 09:54 PM.
Reply With Quote
  #2 (permalink)  
Old March 24th, 2002
Gnutella Veteran
 
Join Date: March 14th, 2002
Location: Canada
Posts: 121
Smilin' Joe Fission is flying high
Question

Anyone?



-SJF
Reply With Quote
  #3 (permalink)  
Old March 24th, 2002
Unregistered
Guest
 
Posts: n/a
Default

If you could understand this you would be busy with your own client making big bucks, why bother helping another guy who could become your competition?
Why use already written source code that works? Oh yea, you can't use GPL code in a commercial client. Wait! Maybe you can sneak it in so you can make money now! How do you think all the other money making spyware clients got their start?

Soapbox off.

Go look at Gnucleus source code or a linux client to see what is little endian etc it is easier. No where does it tell what a GUID is byte order wise, you have to see what others have done, sorry.
Plus you should be working on features and not wasting your time re-hashing old protocol code that has already been written.
Build on top of what has already been done and then post what you have done so other can build on top of that.
Reply With Quote
  #4 (permalink)  
Old March 24th, 2002
Disciple
 
Join Date: January 3rd, 2002
Location: USA,Connecticut
Posts: 12
Joetella is flying high
Default

Here are my routines for IP conversion,
Note that I'm using Byte arrays and not Strings:

Code:
Private Function IPtoByte(ByVal sTemp As String) As Byte()

   On Error GoTo HandleError
   
   Dim lPos As Long
   Dim sBucket() As String
   Dim bTemp() As Byte
   ReDim bTemp(0 To 3)
   
   sBucket = Split(sTemp, ".")
   For lPos = 0 To 3
      bTemp(lPos) = CByte(Val(sBucket(lPos)))
   Next lPos
   IPtoByte = bTemp
   Exit Function
    
HandleError:
   Call LogError("IPtoByte")
   
End Function

Private Function ByteToIP(ByRef bTemp() As Byte, ByVal lTemp As Long) As String

   On Error GoTo HandleError
   
   ByteToIP = CStr(bTemp(lTemp)) _
      & "." & CStr(bTemp(lTemp + 1)) _
      & "." & CStr(bTemp(lTemp + 2)) _
      & "." & CStr(bTemp(lTemp + 3))
   Exit Function
    
HandleError:
   Call LogError("ByteToIP")
   
End Function
Reply With Quote
  #5 (permalink)  
Old March 24th, 2002
Gnutella Veteran
 
Join Date: March 14th, 2002
Location: Canada
Posts: 121
Smilin' Joe Fission is flying high
Thumbs down

Quote:
Originally posted by Unregistered
If you could understand this you would be busy with your own client making big bucks, why bother helping another guy who could become your competition?
Why use already written source code that works? Oh yea, you can't use GPL code in a commercial client. Wait! Maybe you can sneak it in so you can make money now! How do you think all the other money making spyware clients got their start?

Soapbox off.
And this, ladies and gentlemen, is why you should NEVER smoke crack!

Now that my true motives of trying to write a Gnutella client and making millions by riddling it with spyware and adware have been discovered, I think I'll have to retire to a different profession.... like swindling money from old people.

Thanks Mr. Unregistered for your unwarranted conspiracy theory... however, it's just not the answer I'm looking for.

Quote:
Go look at Gnucleus source code or a linux client to see what is little endian etc it is easier. No where does it tell what a GUID is byte order wise, you have to see what others have done, sorry.
Plus you should be working on features and not wasting your time re-hashing old protocol code that has already been written.
Build on top of what has already been done and then post what you have done so other can build on top of that.
1) I already looked at another couple examples of free VB servent code (yes, I'm using Visual Basic, not C++... if I was using C++, I would be able to refer to Gnucleus or some other servent's code now, wouldn't I?) After reading the code for one servent over more than once and performing some meager testing on my own, I am convinced that it is WRONG aside from being poorly written and incredibly difficult to follow in the first place. The second sample of free servent code I have is utterly unreadable. While I have no doubt it probably works, I have no desire to spend more time deciphering another author's code than actually writing mine.

2) I'd rather not "use existing code" because I don't learn anything that way. If I do it myself, I know what I've done and how I've done it. This also makes it a lot easier when I need to fix things that are wrong or add new features. Besides, as I said in #1, there isn't anything "good" written in VB that I can add onto in the first place.

3) I didn't ask for your opinion on what I really ought to be doing with my coding talents. If I want to write my own code for my own servent, that's my own decision.

4) I didn't ask about GUIDs... dunno where you got that from.


- SJF
Reply With Quote
  #6 (permalink)  
Old March 24th, 2002
Gnutella Veteran
 
Join Date: March 14th, 2002
Location: Canada
Posts: 121
Smilin' Joe Fission is flying high
Talking Thanks Joetella!

Quote:
Originally posted by Joetella
Here are my routines for IP conversion,
Note that I'm using Byte arrays and not Strings:

Code:
Private Function IPtoByte(ByVal sTemp As String) As Byte()

   On Error GoTo HandleError
   
   Dim lPos As Long
   Dim sBucket() As String
   Dim bTemp() As Byte
   ReDim bTemp(0 To 3)
   
   sBucket = Split(sTemp, ".")
   For lPos = 0 To 3
      bTemp(lPos) = CByte(Val(sBucket(lPos)))
   Next lPos
   IPtoByte = bTemp
   Exit Function
    
HandleError:
   Call LogError("IPtoByte")
   
End Function

Private Function ByteToIP(ByRef bTemp() As Byte, ByVal lTemp As Long) As String

   On Error GoTo HandleError
   
   ByteToIP = CStr(bTemp(lTemp)) _
      & "." & CStr(bTemp(lTemp + 1)) _
      & "." & CStr(bTemp(lTemp + 2)) _
      & "." & CStr(bTemp(lTemp + 3))
   Exit Function
    
HandleError:
   Call LogError("ByteToIP")
   
End Function
Thanks Joetella! You've given me some clues and, after doing a bit more research of my own, I think I may have found the answer I was looking for. Seems to me that the sample code I have is wrong.... which is partly why I was confused in the first place.

Once again, thanks!

- SJF
Reply With Quote
  #7 (permalink)  
Old March 25th, 2002
Gnutella Veteran
 
Join Date: March 14th, 2002
Location: Canada
Posts: 121
Smilin' Joe Fission is flying high
Red face

OK, so maybe *I* was wrong about the sample code being wrong. But hey, those are the breaks.
Reply With Quote
  #8 (permalink)  
Old March 29th, 2002
Devotee
 
Join Date: March 29th, 2002
Location: Germany
Posts: 21
Pferdo is flying high
Default if you want to...

you can have a look at my Data-Conversion-routines...

see the zip file below

CU
Attached Files
File Type: zip modconversion.zip (1.1 KB, 82 views)
Reply With Quote
  #9 (permalink)  
Old March 29th, 2002
Gnutella Veteran
 
Join Date: March 14th, 2002
Location: Canada
Posts: 121
Smilin' Joe Fission is flying high
Default

Thanks a bunch Pferdo!

I did download your code, even if it was just to make sure mine was correct (I was able to finish my own data conversion functions recently). I even created a test app and had your function create a value while mine decoded it and vice versa to see if each of our functions came up with the same answers. They do.

Here's my code... just in case you or anyone else wants to see how I did it. It's actually quite different than the way I've seen everyone else do it so far. But, from the meager testing I've done on it, I'm confident it works correctly even though I haven't gotten far enough with my servent yet to be able to use it.

To anyone downloading this code, if you find a bug could you let me know?
Attached Files
File Type: zip moddc.zip (1.5 KB, 93 views)
Reply With Quote
  #10 (permalink)  
Old April 25th, 2002
Devotee
 
Join Date: March 29th, 2002
Location: Germany
Posts: 21
Pferdo is flying high
Default performance is REALLY IMPORTANT...

...while using VB!

A professional C++ and VB programmer "B.Olaf" helped me to make faster routines, and now I finally know a bit more about RTLMoveMemory and the Memory in general... the routines listed below are 2 or even 3 times faster the my old ones: Use them!!!


<code>
Option Explicit
'Functions using 'RtlMoveMemory' by "B.Olaf Rasch" [bolaf-rasch@gmx.de]
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef lpvDest As Any, ByRef lpvSource As Any, ByVal cbCopy As Long)

Function EncodeNo16(ByVal Number As Long) As String
'"Long" is used to replace "unsigned int"
EncodeNo16 = Space(2)
CopyMemory ByVal EncodeNo16, Number, 2
End Function

Function DecodeNo16(ByVal Number As String) As Long
'"Long" is used to replace "unsigned int"
CopyMemory DecodeNo16, ByVal Number, 2
End Function

Function EncodeNo32(ByVal Number As Double) As String
Dim lngTemp As Long

If Number > 2147483647# Then
lngTemp = CLng(Number - CDbl(4294967296#))
Else
lngTemp = CLng(Number)
End If
EncodeNo32 = Space(4)
CopyMemory ByVal EncodeNo32, lngTemp, 4
End Function

Function DecodeNo32(ByVal Number As String) As Double
Dim lngTemp As Long

CopyMemory lngTemp, ByVal Number, 4
If lngTemp < 0 Then
DecodeNo32 = CDbl(4294967296#) + lngTemp
Else
DecodeNo32 = CDbl(lngTemp)
End If
End Function
</code>

thx!!!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop The Confusion of Bit/Byte Angry Pirate Open Discussion topics 0 June 20th, 2006 07:07 PM
Single byte in Query-Hit trailer mario5 NapShare (Cross-platform) 0 February 11th, 2003 01:56 PM
Searching in multi-byte languages (Japanese, Korean) Unregistered General Discussion 3 November 24th, 2002 10:02 PM
Splitting download segments byte loss? HelgeB General Discussion 6 July 11th, 2002 06:24 AM
Server sending only 16 byte 'packets' Unregistered General Gnutella Development Discussion 1 May 31st, 2002 07:35 AM


All times are GMT -7. The time now is 02:30 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.