Package DE_EPAGES::Core::API::Net
Functions for TCP/IP networking.
@EXPORT_OK |
Functions
- ExistsURLFile
- GetFastestEpagesMirror
- GetFile
- GetHttpContent
- GetHttpResponse
- Int2Ip
- Ip2Int
- SupportedIpVersions
- localhostName
ExistsURLFile
check if file exists
Syntax |
my $Exists = ExistsURLFile($Url, $FileName); |
Input |
|
Return |
|
GetFastestEpagesMirror
Returns the fastest URL to $RelativePath from a list of epages mirrors, e.g.: http://epages.com/RPMS/$RelativePath. If envvar EPAGES_PATCH_DATA_REPO is set, prefer that mirror (space-separated URL or absolute path). If envvar EPAGES_REPO is set, prefer that mirror (rather than EPAGES_PATCH_DATA_REPO). Example: EPAGES_PATCH_DATA_REPO=/my/repos; EPAGES_REPO=http://epages.com/RPMS Result: http://epages.com/RPMS is used Example: EPAGES_PATCH_DATA_REPO=/my/repos; EPAGES_REPO= Result: /my/repos is used Otherwise, find mirrors in default places.
Syntax |
$Url = GetFastestEpagesMirror($RelativePath); |
Example |
my $Url = GetFastestEpagesMirror('patch/6.14.3/epages-6.14.3-patch-data.tar.gz'); returns: http://epages.com/RPMS/patch/6.14.3/epages-6.14.3-patch-data.tar.gz |
Input |
|
Return |
|
GetFile
Loads a file from internet via HTTP "GET" request and saves it to filename.
Syntax |
my $ResponseCode = GetFile($Url, $FileName); my $ResponseCode = GetFile($Url, $FileName, $Timeout); |
Input |
|
Return |
|
GetHttpContent
Load document from internet.
Syntax |
$Content = GetHttpContent($Url); |
Input |
|
Return |
|
GetHttpResponse
Loads a document from internet via HTTP "GET" request.
Syntax |
$Response = GetHttpResponse($Url); $Response = GetHttpResponse($Url, $Timeout); $Response = GetHttpResponse($Url, $Timeout, $UserAgentString); |
Input |
|
Return |
|
Int2Ip
Converts an integer to an IP.
Syntax |
$IP = Int2Ip($IP); |
Input |
|
Return |
|
Ip2Int
Converts an ip to an integer.
Syntax |
$Int = Ip2Int($IP); |
Input |
|
Return |
|
SupportedIpVersions
Returns an array of address families containing one/more of: 6 (for IPv6), 4 (for IPv4)
Syntax |
@IpVersions = SupportedIpVersions(); |
Return |
|
localhostName
Returns the name of localhost: - ipv6-localhost: if UNIX and IPv6 works - localhost: otherwise
Syntax |
$localhost = localhostName(); |
Return |
|