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.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (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
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 06:37 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.