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.


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 04:48 PM.


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

Copyright © 2020 Gnutella Forums.
All Rights Reserved.