in reply to Re: Questions about LWP`
in thread Questions about LWP`

Thank you for the response, but I can't find any information as to locking traffic collection with TCPDUMP or Tshark onto a PID, for program specific traffic collection. If you don't mind, a link, or option would be greatly appreciated. Wireshark is not the way I want to go, since I want to automate the whole process. I have several LWP agents that will be running on given system at the same time. If I can ask LWP what src port it is about to use, then I can spin up a tcpdump session against that src port, no matter where it is going. So, while asking LWP what SRC port it is going use prior to sending may be considered busy work, I have a very good reason for asking. If I were running only one process, then it wouldn't be a problem. I sincerely appreciate your help. Many thanks in advance.

Replies are listed 'Best First'.
Re^3: Questions about LWP`
by Anonymous Monk on Dec 12, 2010 at 04:39 UTC
    I have a very good reason for asking...

    Remember your previous question about choosing a port? If you chose the port, then you know ahead of time which port it is :)

      Thanks, but I ran tests with the option of assigning the port. Unfortunately it doesn't work for HTTPS. :-(
      and, for some unknown reason it was problematic for multiple file collections through the same LWP object. Any other help? I have a fall back method, but it will slow my process down, greatly, or I have to go to a more complicated method, that I don't want to use. Thanks again for your help. Greatly appreciate the chatter. :-)
        Follow the trace :) So I would try overriding
        *LWP::Protocol::http::Socket::connect = *LWP::Protocol::http10::Socket::connect = *LWP::Protocol::https::Socket::connect = *LWP::Protocol::https10::Socket::connect = sub { my $self = shift; my $sock = $self->SUPER::connect(@_); ## get port here return $sock; };