GetServerIP()
Last updated January 12, 2004
Version: 1 | Requires: ColdFusion 5 | Library: UtilityLib
Description:
This tag is able to get the ip address of your server. This can be used for servers that are in a cluster and you need to know the ipaddress of the computer throwing an error. This will only work for one ip of a machine.
Return Values:
Returns a string.
Example:
Parameters:
No arguments.
Full UDF Source:
<cfscript>
/**
* Gets the ip address of the server.
*
* @return Returns a string.
* @author Robert Everland III (reverland@reactivevision.com)
* @version 1, January 12, 2004
*/
function GetServerIP() {
var iaclass="";
var addr="";
// Init class
iaclass=CreateObject("java", "java.net.InetAddress");
//Get Local host variable
addr=iaclass.getLocalHost();
// Return ip address
return addr.getHostAddress();
}
</cfscript>
Search CFLib.org
Latest Additions
Shawn Porter added
DeMoronize
3 hour(s) ago
Chris Carey added
readPropertiesFi...
1 day(s) ago
Randy Johnson added
lastDayofWeek
3 day(s) ago
Frank Marion added
sitemapPing
7 day(s) ago
Top Rated
QuickSort
Rated 5.0, 3 time(s)
indentXml
Rated 5.0, 3 time(s)
queryColumnsToSt...
Rated 5.0, 3 time(s)
generateSsccAsn
Rated 5.0, 3 time(s)