![]() |
| |||||||
| Register | FAQ | The Twelve Commandments | Members List | Calendar | Arcade | Find the Best VPN | Today's Posts | Search |
| General Gnutella Development Discussion For general discussion about Gnutella development. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |
| |||
| 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 |
![]() |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stop The Confusion of Bit/Byte | Angry Pirate | Open Discussion topics | 0 | June 20th, 2006 08:07 PM |
| Single byte in Query-Hit trailer | mario5 | NapShare (Cross-platform) | 0 | February 11th, 2003 02:56 PM |
| Searching in multi-byte languages (Japanese, Korean) | Unregistered | General Discussion | 3 | November 24th, 2002 11:02 PM |
| Splitting download segments byte loss? | HelgeB | General Discussion | 6 | July 11th, 2002 07:24 AM |
| Server sending only 16 byte 'packets' | Unregistered | General Gnutella Development Discussion | 1 | May 31st, 2002 08:35 AM |