For Programmers: Free Programming Magazines  


Home > Archive > LDAP > January 2006 > Which server did I connect to?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Which server did I connect to?
Brian Thomas

2006-01-09, 11:48 pm

As usual, sorry if this has been asked before. I've been scouring the
module documentation and thus far been unable to find an answer to
this question. Googling also yields no results.

If I pass an arrayref of hosts to the the new() method (or I suppose
even if I just passed one), is there any way later on, via another
method or otherwise, to know what server I'm connected to? This seems
like a pretty important thing to be able to find out, even better if
there was like a status() method that could return host, port, TLS
status, etc. for the object's associated server.

Any ideas?
Daniel M.

2006-01-09, 11:48 pm

I just used the module Data::Dumper to look at the
structure and you should be able to get it by doing:

#-----------------------------------------------------------
use Net::LDAP;
my $ldap = new Net::LDAP ...
.....
print "I am connected to: " . $ldap->{net_ldap_host} .
"\n" ;
#-----------------------------------------------------------

Let me know if that helps.

DanInCT.

--- Brian Thomas <brian.thomas@gmail.com> wrote:

> As usual, sorry if this has been asked before. I've
> been scouring the
> module documentation and thus far been unable to
> find an answer to
> this question. Googling also yields no results.
>
> If I pass an arrayref of hosts to the the new()
> method (or I suppose
> even if I just passed one), is there any way later
> on, via another
> method or otherwise, to know what server I'm
> connected to? This seems
> like a pretty important thing to be able to find
> out, even better if
> there was like a status() method that could return
> host, port, TLS
> status, etc. for the object's associated server.
>
> Any ideas?
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com