C
coltrane
Does any class provide a method for converting a string ip address to a
long and long to ip address?
thanks
john
long and long to ip address?
thanks
john
coltrane said:Does any class provide a method for converting a string ip address to a
long and long to ip address?
thanks
john
coltrane said:Does any class provide a method for converting a string ip address to a
long and long to ip address?
The other posts will help you along, but I'm curious how you intend tocoltrane said:Does any class provide a method for converting a string ip address to a
long and long to ip address?
Ryan said:The other posts will help you along, but I'm curious how you intend to
represent an IP as a long. Does 127.0.0.1 become 127001? If so, then what
about 12.70.0.1?
Duuuh. That didn't occur to meByteCoder said:You could use leading zero's. So 127.0.0.1 would become: "127000000001"
Ryan said:The other posts will help you along, but I'm curious how you intend to
represent an IP as a long. Does 127.0.0.1 become 127001? If so, then
what about 12.70.0.1?
Another thing that does not seem to have occured to anyone - a long isRyan said:Duuuh. That didn't occur to me![]()
Steve said:Another thing that does not seem to have occured to anyone - a long is
not long enough to hold an IPv6 address. And any code that assumes that
IP addresses are only 4 bytes is broken.
Thanks for the info. I thought a long had more memory available than an
int. Guess not.
Michiel said:It does, 8 bytes vs 4 for an int. But an IPv6 address is 128 bits or 16
bytes.
Michiel
Michiel Konstapel said:It does, 8 bytes vs 4 for an int. But an IPv6 address is 128 bits or 16
bytes.
Michiel
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.