Client IP address

11 views
Skip to first unread message

ZPT

unread,
Oct 19, 2010, 8:08:46 AM10/19/10
to Snorkel
Hello,
I am not able to get IP address of client. (Am I bad reader of your
documentation?)
I want to write a small aplication with client access and need to use
restrictions, so I need to know who a where is login.
Thanks
Zdenek

Walter Capers

unread,
Oct 19, 2010, 4:13:05 PM10/19/10
to snorkel...@googlegroups.com

How are you getting the up address?

Message has been deleted

ZPT

unread,
Oct 20, 2010, 9:25:12 AM10/20/10
to Snorkel
I have a lot information about communication via snorkel_obj_t
snorkel_obj_get(...) functions.
In addition to communication I need to get WHO IS the client - His/Her
IP address. Thats all. But I dont know how.
Zdenek

Walter Capers

unread,
Oct 21, 2010, 6:37:39 AM10/21/10
to snorkel...@googlegroups.com
Once you have a connection, i.e., your callback is called, you can obtain the ip address by passing in the open connection object.  For example,

call_status_t 
my_http_callback (snorkel_obj_t http,
                            snorkel_obj_t connection)
{
   char szbuff[512];
   .
   .
   snorkel_obj_get (connection, snorkel_attrib_get_ipaddr, szbuff, sizeof(szbuff));
.
.
return HTTP_SUCCESS;
}

In the example above,  the IP address of the attached client is retrieved and stored in the buffer szbuff.  

BEST REGARDS
Walt
Reply all
Reply to author
Forward
0 new messages