Dicop::Connect - connect upstream server via LWP or WGET



NAME

Dicop::Connect - connect upstream server via LWP or WGET


SYNOPSIS

        use Dicop::Connect qw/_connect_server/;
        $self->_connect_server ($url, undef );


REQUIRES

Exporter, Dicop::Event


EXPORTS

Can export on request:

        _connect_server()
        _load_connector()


DESCRIPTION

Dicop::Connect provides a method for connecting other servers (HTTP, FTP etc) and fetching URLs from them, or sending them FORM requests via HTTP POST.


METHODS

_connect_server

Make one connection to a server and send requests to it. Retry multiple times in case of error. Return result of connect.

        my $result = $self->_connect_server ($url,$params,$max_tries);

Returns an object which can be queried for is_sucess(), code() and contents().

$max_tries defaults to 20. if $url is undefined, the predefined (config) server or an random server will be used, otherwise the URL must contain protocoll, hostname etc:

        my $result = $self->_connect_server(undef,$params);      # main server
        my $result = $self->_connect_server(
          'http://localhost:8000/files/worker/linux/test/');    # file server

_load_connector

        $self->_load_connector($config, $arguments);

This routine loads a connector module (specified in config or arguments as key 'via'), then constructs a user-agent object and sets the proper user agent string in it. The user agent will be used via $self->{ua} later on in _connect_server().


AUTHOR

(c) Bundesamt fuer Sicherheit in der Informationstechnik 1998-2006

DiCoP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

See http://www.bsi.de/ for more information.