in reply to Getting port number with AnyEvent::Socket

Try getsockname $socket;
  • Comment on Re: Getting port number with AnyEvent::Socket

Replies are listed 'Best First'.
Re^2: Getting port number with AnyEvent::Socket
by MiggyMan (Sexton) on Jun 13, 2010 at 13:04 UTC
    Gives me the listening port rather than the random port the connections comming from!
        I love you :D

        What i actually ended up with is my ($port,$addr) = sockaddr_in(getpeername($shandle->fh));

        Which works like a charm!