|
-
January 8th, 2003, 06:39 AM
#1
How to get an IP-String from SOCKADDR_IN
Hi,
again a relative simple question... but I found no answer:
I wrote a simple server, which accepts connections as usual. I passed a SOCKADDR_IN-struct to the accept-call to obtain Client-IP, port etc.
But how to "decrypt" the IP from SOCKADDR_IN.sin_addr ?
I know that there is a function for "encrypting" an IP-string to an IP-Address. But I have an IP-Address and want a string representation.
I'm sure somebody can tell me ;o)
Thanx in advance
Juergen
-
January 8th, 2003, 07:11 AM
#2
-
January 8th, 2003, 06:07 PM
#3
ip = inet_ntoa(si.sin_addr);
-
January 9th, 2003, 01:32 PM
#4
Thanx
After sleeping a little, I found myself in a bit confused state about this posting, because I did really ask myself: Oh my god, why did I post this ?
Stupid me I used that function before. This was in the times before I started using the Borland TSocket-Class.
Anyway, I think I must organize my work some other way, because I often forget to sleep and eat, and post stupid questions in order ;o)
Sorry, for posting something useless... wont happen again... I promis ...
Greetings
Juergen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|